Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css div未正确对齐_Css_Html_Xhtml_Alignment - Fatal编程技术网

Css div未正确对齐

Css div未正确对齐,css,html,xhtml,alignment,Css,Html,Xhtml,Alignment,我有一些相当简单的CSS代码,似乎不工作的权利 html, body { border:0; margin:0; padding:0; } body { font:12px Arial, Helvetica, sans-serif; background: url(../img/bg-tile.png) repeat; color: #444} .content{ background-color:#CCDDEE; width:100%; margin: 0px aut

我有一些相当简单的CSS代码,似乎不工作的权利

html, body { border:0; margin:0; padding:0; }
body { font:12px Arial, Helvetica, sans-serif; background: url(../img/bg-tile.png) repeat; color: #444}

.content{
    background-color:#CCDDEE;
    width:100%;
    margin: 0px auto;
}

.column{
    padding:0% 2% 0% 0%;
    width:29%;
    float:left;
    height:auto;
}

.myText{
    padding:0px 25% 0px 0px;
    font-size:16px;
}

.footer{
    margin-bottom:2%;
    padding:0px;
    position: absolute;
}

.wrapper { 
    width:75%;
    height:auto;
    margin:1% auto; 
}
我的html如下所示:

<body>
    <div class="wrapper">
        <img src="img/logo2.jpg" alt="" />
                    <!--Snipped some code Just a nav -->
        <br /><br />
        <div class="content">
            <img src="img/slider6.jpg" alt="" /><br /><br />
            <div class="column">
                <p class="myText">
                Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text,
                </p>
            </div>
            <div class="column">
            <p class="myText">
                Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text,
            </p>
            </div>
            <div class="column">
            <p class="myText">
                Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text, Testing some text,
            </p>
            </div>
        </div>
        <br />
    </div>
    <div class="footer">
        &copy;2013 blahblahblah&reg; | Terms of Use | Privacy Policy | Press Inquiries
    </div>



</body>
</html>





测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,

测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,

测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,测试一些文本,


&抄袭;2013 blahblahblah®;|使用条款|隐私政策|新闻查询
我遇到的问题是,我的脚像这样坐在我的“柱子”上(图片输入)


添加
溢出:隐藏
.content
将使
.content
正确包含浮动元素。这也将使背景色适用于浮动列

如果不希望
.content
包含浮动元素,请添加
溢出:隐藏改为
.wrapper

您看到的问题是由于列上的
浮动
。CSS float将元素从正常流中移除,因此在渲染时,包含元素的高度不会考虑浮动元素的高度

因此,页脚将在内容之后呈现(正确),但
.content
的高度不正确

另一种方法是
清除
浮动内容-请参阅和