我试图将我的 3 个 div 与 id = #boxes1、#boxes2、#boxes3 并排放置。由于某种原因,#boxes3 低于#boxes2。我的容器应该足够大,不会向下移动。我知道它应该“ float :左;”但我现在不知道为什么它会下降。
这是我来自 Wordpress 的 loop.php http://pastebin.com/uh00RT8v 这是 CSS http://pastebin.com/FU3tqbRM
谢谢!
最佳答案
我认为您错过了 <div id="boxes2">
的结束标记.所以它没有正确呈现。
<div id="boxes2">
<!--So lets set our category to only show technology-->
<?php query_posts($query_string . '&cat=9'); ?>
<!--Start the loop-->
<?php while ( have_posts() ) : the_post(); ?>
<!--Inside the loop-->
<div class="box">
<!--The post title-->
<h1><?php the_title(); ?></h1>
<!--The post image-->
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('homepage-thumb', array('alt' => '', 'title' => '')); ?></a>
</div>
<?php endwhile; ?>
</div> <!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<< This one -->
<?php rewind_posts(); ?>
关于css - 设置彼此相邻的div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10327364/