【发布时间】:2012-12-16 18:50:37
【问题描述】:
我希望我的边距在主体开始变窄之前完全折叠,就像在http://www.skysports.com/ 上一样,只有当边距完全折叠时,主体才能变窄。多年来,我一直在我的 css 中使用 px、em 和 % 并且无法使其工作。这是我到目前为止所拥有的。
html { background-image:url(images/webBackground.jpg);
background-size:100% 100%;
background-repeat:no-repeat;
background-attachment:fixed;
height:100%; width:100%;
}
body { background:black;
height:100%; width:75%;
margin:0 12.5% 0 12.5%;
}
#container { width: 100%; height: 100%; }
【问题讨论】:
-
试试
auto而不是12.5%。 -
collapse fully before the body starts是什么意思?