【发布时间】:2017-03-21 13:20:12
【问题描述】:
我想要一行 3 列,根据其中一列内文本的长度/大小,所有 3 列应该具有相同的高度。因此,考虑到最大的列,这 3 列应具有相同的高度并位于同一行。
这是我得到的错误:
这是我拥有的代码:
<?php// Define our WP Query Parameters ?>
<?php $the_query = new WP_Query( 'posts_per_page=3' ); ?>
<?php// Start our WP Query ?>
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<div class="col-sm-6 col-md-3">
<div class="thumbnail"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail(array(100, 100)); ?></a>
<div class="caption">
<?php// Display the Post Title with Hyperlink?>
<h3 class="center"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
<!--// Repeat the process and reset once it hits the limit-->
</div>
</div>
</div>
<?php
endwhile;
wp_reset_postdata();
?>
这是 CSS:
div.caption{
text-align: center;
}
div.thumbnail{
border: 4px inset black;
height: 200px;
}
h3.center{
font-size: 20px;
}
【问题讨论】:
-
嗨,我也看到了那个帖子,但没有一个解决方案解决了这个问题。有些没有均匀分布列,有些则根本不起作用。
标签: css wordpress twitter-bootstrap