我正在尝试用div隔开2个页面。其中1个是内容,另外1个是侧边栏。css在左边修复了div
侧栏必须位于左侧。
这里是我目前使用的做它的代码:
#SideBar
{
float: left;
width: 300px;
background-color: #727272;
height: 100%;
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
}
#Content
{
float: left;
right: 0px;
top: 0px;
bottom: 0px;
position: absolute;
left: 300px;
padding: 3px;
font-size:12px;
overflow:auto;
}
第一次它似乎正常工作,但是当我去恢复下降(调整)我的浏览器,它brokes。
位于侧边栏的div溢出。是的,我正在讨论侧栏的内部元素。
为什么侧边栏不能固定在左侧?
在此先感谢。
编辑:
我的HTML是:
<div id="SideBar">
Sidebar content goes here
</div>
<div id="Content">
Main content goes here
</div>
你是什么意思溢出? – Oliver 2013-02-22 22:53:40
你能告诉我们你的HTML吗? – 2013-02-22 22:53:54
@TurnItUp问题是,我不明白你的问题。 :-) – Oliver 2013-02-22 22:56:22