我在一个 wordpress 网站上工作,我对 PHP 不是很熟悉。我设法以某种方式在图像下方生成了以下空行:
http://i.imgur.com/PazQgLl.jpg
所以我的问题是如何删除或避免图像下方的空白区域。
这是页面的 PHP。我认为原因必须在这里的某个地方。
<?php
/**
* The template part for displaying the post meta information
*
* @package Editor
*/
?>
<div class="entry-meta">
<!-- Grab and display the featured image -->
<?php if ( '' != get_the_post_thumbnail()) {?>
<a class="frontfeatured-image" href="<?php the_permalink()?>">
<?php the_post_thumbnail('thumbnail-image')?>
</a>
<?php }?>
<!--
<ul class="meta-list">
<?php if ( has_category() ) { ?>
<li class="meta-cat"><?php the_category( ', ' ); ?></li>
<?php } ?>
<?php $posttags = get_the_tags(); if ( $posttags ) { ?>
<li class="meta-tag"><?php the_tags( '' ); ?></li>
<?php } ?>
<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
<li class="meta-comment">
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'editor' ), __( '1 Comment', 'editor' ), __( '% Comments', 'editor' ) ); ?></span>
</li>
<?php endif; ?>
</ul>
-->
</div>
CSS:
.entry-meta {
display: inline-block;
width: 40%;
margin-right: 10px;
vertical-align: top;
border-width: 10px;
border-color: #000000;
border-style: solid;
}
@media (max-width: 768px) {
.entry-meta {
margin-bottom: 0%;
width: 100%;
}
}
.frontfeatured-image {
display: inherit;
border-style: solid;
border-color: #000000;
border-width: 0px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
width: 100%;
-webkit-filter: grayscale(1);
filter: grayscale(1);
-moz-transition:-moz-transform 0.5s ease-in;
-webkit-transition:-webkit-transform 0.5s ease-in;
-o-transition:-o-transform 0.5s ease-in;
-moz-transition:-moz-transform 0.5s ease-out;
-webkit-transition:-webkit-transform 0.5s ease-out;
-o-transition:-o-transform 0.5s ease-out;
}
.frontfeatured-image:hover{
-moz-transform:scale(1.02);
-webkit-transform:scale(1.02);
-o-transform:scale(1.02);
color: #000000;
}
试试这个
.frontfeatured-image img{
float: left;
}
我是一名优秀的程序员,十分优秀!