我想让一个页面水平分成两半。我希望只使用HTML/CSS来实现,而不使用JS。我做错了什么?
谢谢。
谢谢。
CSS
#container {
min-height:100%;
}
#top_div {
height:50%;
width:100%;
background-color:#009900;
margin:auto;
text-align:center;
}
#bottom_div {
height:50%;
width:100%;
background-color:#990000;
margin:auto;
text-align:center;
color:#FFFFFF;
}
HTML
<div id="container">
<div id="top_div">top</div>
<div id="bottom_div">bottom</div>
</div>
body,html {height:100%;}
- bitWorking