我正在尝试设置帖子标题和文章摘录,使其在特征图片旁边的日期下对齐,但我只能设置日期,而不能设置标题和除其他。
这是我的日期CSS,它是一个简单的浮动:
.post-thumbnail {
width: 24%;
float: left;
margin-right: 20px;
}HTML
<div class="post-meta group">
<p class="post-category"><?php the_category(' / '); ?></p>
<p class="post-date"><?php the_time('j M, Y'); ?></p>
</div><!--/.post-meta-->
<h2 class="post-title">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</h2><!--/.post-title-->
<?php if (ot_get_option('excerpt-length') != '0'): ?>
<div class="entry excerpt">
<?php the_excerpt(); ?>
</div><!--/.entry-->
<?php endif; ?>当我将float: left添加到类.post-meta中时,它会移动标题和摘录,但不会在post元下对齐。
这是我的新www.gazetbits.com。任何指南将不胜感激,或它是正确的分组标题和帖子,但在一个部门和应用浮动。
谢谢
发布于 2014-09-29 10:21:25
.post-meta太高了。我实现了您想要的行为,添加了以下规则:
.post-meta {
height: 22px;
}更改显示类型的或:
.post-meta {
display: table;
}https://stackoverflow.com/questions/26097430
复制相似问题