所以我试图让一个图像文件在 div 的中间垂直对齐,文本在我的移动 Wordpress 主题的右侧。不幸的是,在图像上使用“vertical-align:middle”会导致以下结果:
这是我的CSS:
<div <?php post_class('post clearfix'); ?> id="post-<?php the_ID(); ?>">
<div style="vertical-align:middle"><?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail('post', 'secondary-image'); endif; ?></div>
<h2 class="title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'themater' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div class="postmeta-primary-fp">
<?php echo get_the_date(); ?></div>
<div class="postmeta-primary-fp"> <?php if(comments_open( get_the_ID() )) {
?><span class="meta_comments"><?php comments_popup_link( __( '<b>0</b> comments', 'themater' ), __( '<b>1</b> comment', 'themater' ), __( '<b>%</b> comments', 'themater' ) ); ?></span><?php
} ?>
</div>
任何帮助将不胜感激!