我想将页面分为两半(不是列)而是一行(顶部和底部),并给出2种颜色,一种用于顶部,一种用于底部。

最佳答案

demo on dabblet.com
html:

<div id="top">top</div>
<div id="bottom">bottom</div>
CSS:
#top,
#bottom {
    position: fixed;
    left: 0;
    right: 0;
    height: 50%;
}

#top {
    top: 0;
    background-color: orange;
}

#bottom {
    bottom: 0;
    background-color: green;
}

关于html - 将页面分为两半(顶部和底部),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10886927/

10-12 17:37