Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在DIV中显示标题?_Php_Css_Wordpress - Fatal编程技术网

Php 如何在DIV中显示标题?

Php 如何在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,但它没有正确显示。然后我删除了。我更改为现有div的代码

但是表演。我试过了,但没有成功

CSS

Div PHP

<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;
}