css - 设置彼此相邻的div

标签 css wordpress html css-float

我试图将我的 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/

相关文章:

javascript - 使用 JavaScript 对某些日期进行排序

1 VPS 上的 WordPress.org 和 Vanilla 论坛

php - WooCommerce 购物车和结账中运输方式的额外承运商字段

html - 使用 z-index 将 div 放置在另一个之上

jquery - JSSOR slider 将无法正确定位

javascript - 未捕获的类型错误 : Cannot read property 'text' of undefined for getting selected value in java script

html - 框阴影和溢出 : scroll

css - 有没有办法使用 CSS3 增加一个数字?

css - 如何删除链接、按钮、输入、文本区域和按钮上的虚线轮廓

html - 多个img可以组成图片背景吗?