我正在尝试用CSS创建一个类似Windows的资源管理器,现在我的代码如下。
#explorer的位置不正确。这是对我想要做的事情的一点解释。
sys_top在顶部,始终可见
页面底部的info_Bar,始终可见
左侧导航栏,宽度为20%
资源管理器在右侧,宽度为80%
HTML:
<div id="sys_top"></div>
<div id="navbar"></div>
<div id="explorer"></div>
<div id="infobar"></div>CSS:
html, body {
padding:0;
margin:0;
height:100%;
cursor: default;
font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif;
font-size: 12px;
}
#sys_top {
background: url(../menu_files/bg.png) repeat-x;
width:100%;
top:0;
position: fixed;
}
#navbar {
width: 20%;
height: 100%;
float:left;
left: 0;
top: 30px;
position: fixed;
border-right: #CCCCCC solid 1px;
}
#explorer {
width: 500px;
height:300px;
float:right;
top: 30px;
overflow:auto;
}
#infobar {
height: 120px;
width: 100%;
bottom:0;
position: fixed;
display:block;
margin-top: 5px;
margin-left: 5px;
} 发布于 2010-12-16 00:08:19
你可以说:
右侧的
资源管理器,宽度为80%
你的css会说:
#explorer {
width: 500px;
...最终答案:
body {
overflow: hidden;
}
#navbar {
position: absolute;
width: 20%;
bottom: 120px;
left: 0;
top: 30px;
}
#explorer {
position: absolute;
top: 30px;
right: 0;
bottom: 120px;
overflow: auto;
width: 80%;
}你应该删除#explorer的浮动,高度,边距和#导航栏的位置:固定,高度,浮动。
https://stackoverflow.com/questions/4451286
复制相似问题