Php 如何在DIV中显示标题?
我试图将标题移到图片的上部。我创建了一个div,但它没有正确显示。然后我删除了。我更改为现有div的代码 但是表演。我试过了,但没有成功 CSS Div PHPPhp 如何在DIV中显示标题?,php,css,wordpress,Php,Css,Wordpress,我试图将标题移到图片的上部。我创建了一个div,但它没有正确显示。然后我删除了。我更改为现有div的代码 但是表演。我试过了,但没有成功 CSS Div PHP <div id="baslist"> <div class="post-thumbnail"> <a href="<?php the_permalink(); ?>" rel="bookm
<div id="baslist">
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<?php the_post_thumbnail( 'tie-medium' ); ?>
<span class="fa overlay-icon"></span>
</a>
<h2 class="post-box-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
</div><!-- post-thumbnail /-->
<?php endif; ?>
</div>
.lazy-enabled #main-content .first-news .tie-appear.post-thumbnail a{
background-color: red !important;
display: table-cell;
}
.lazy enabled#主要内容。第一条新闻。tie-appear.post-缩略图a{
背景色:红色!重要;
显示:表格单元格;
}
使用position:absolute
将其定位在相对定位的div顶部您需要缩略图包装为position:relative
,标题为position:absolute
。然后你可以把它放在包装纸的底部,并添加你需要的任何边距
。发布缩略图{
位置:相对位置;
}
.邮件缩略图.邮箱标题{
位置:绝对位置;
底部:0;
利润率:20px;
}
.邮件缩略图.邮箱标题a{
背景色:红色!重要;
显示:表格单元格;
字体大小:25px;
颜色:白色;
}
在div中不起作用。它确实起作用。你只要把它做好就行了。外部div是相对的。内部跨度或div是绝对的。
<div id="baslist">
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<?php the_post_thumbnail( 'tie-medium' ); ?>
<span class="fa overlay-icon"></span>
</a>
<h2 class="post-box-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
</div><!-- post-thumbnail /-->
<?php endif; ?>
</div>
.lazy-enabled #main-content .first-news .tie-appear.post-thumbnail a{
background-color: red !important;
display: table-cell;
}