【问题标题】:CSS - IE don't get the margin-bottom from the last divCSS - IE 没有从最后一个 div 获得底部边距
【发布时间】:2011-04-25 01:52:31
【问题描述】:

我有一个容器,其中有一些 div:页眉、内容、页脚(作为标准应用程序)。

这是结构:

<body> 
    <div> 
        <div id="ROOT" > 
            <div id="ROOT_0" > 
                Header
            </div>

            <div id="ROOT_1" > 
                Content
            </div>

            <div id="ROOT_2" > 
                Footer
            </div>
        </div>
    </div>
</body>

实际的 CSS :

html {height:101%;}
body {background:#999999;}

#ROOT{ background-color:#333333; width:980px; margin-left:auto; margin-right:auto; overflow:auto;}
#ROOT_0{background-color:#FF9933; width:970px; text-align:center; float:left; margin-top:5px; margin-left:5px; margin-right:5px; margin-bottom:5px;}
#ROOT_1{width:980px; text-align:center; float:left; background-image:url(../img/sfondofc.jpg);}
#ROOT_2{background-color:#FF9933; width:970px; padding-top:5px; padding-bottom:5px; text-align:center; float:left; margin-top:5px; margin-bottom:5px; margin-left:5px; margin-right:5px; font-weight:bold; font-size:13px;}

background-color:#FF9933; width:970px; padding-top:5px; padding-bottom:5px; text-align:center; float:left; margin-top:5px; margin-bottom:5px; margin-left:5px; margin-right:5px; font-weight:bold; font-size:13px;

不幸的是,在 IE (6) 上我看不到 margin-bottom:5px;最后,我有页脚。我需要改变哪些礼仪?干杯

【问题讨论】:

    标签: css internet-explorer margin


    【解决方案1】:

    为什么将html的height属性设置为101%?

    【讨论】:

    • 嗯,这只是一个“把戏”。我的网站有些页面很长,有些则没有那么长。所以,如果我总是想要左侧的滚动条,我将 html 设置为 101%!所以网站不会左右移动:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-08-09
    • 1970-01-01
    • 1970-01-01
    • 2016-07-19
    • 2014-02-05
    • 2013-07-29
    • 1970-01-01
    相关资源
    最近更新 更多