【发布时间】:2014-07-16 12:19:56
【问题描述】:
我正在尝试创建这样的东西:
HTML 是:
<div id="container">
<header></header>
<main>
<section class="half"></section>
<section class="half"></section>
</main>
</div>
而 CSS 是:
* {
margin: 0; padding: 0;
}
html, body, #container {
height: 100%;
}
header {
height: 50px;
background: gray;
}
main {
height: 100%;
background: green;
}
.half {
height: 50%;
}
.half:first-child {
background: blue;
}
.half:last-child {
background: yellow;
}
在其中,我在顶部有一条细丝带,我想将屏幕的其余部分分成两个相等的部分,但我不希望出现垂直滚动条。
我为main 尝试了margin-bottom: 50px;,但没有成功。我该怎么办?
【问题讨论】: