Windows 7 explorer in CSS layout

China☆狼群 提交于 2019-12-25 04:31:20

问题


I'm trying to make a Windows Explorer-like in CSS and for now here is my code.

The #explorer is not positionned correctly. Here is a little explanation of what i'm trying to make.

sys_top on top, always visible

info_Bar at the bottom of the page, always visible

navbar at the left, width of 20%

explorer at the right, 80% width

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;
} 

回答1:


You say:

explorer at the right, 80% width

and your css says:

#explorer {
width: 500px;
...

FINAL ANSWER:

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%;
}

You should drop float, height, margins for #explorer and position:fixed, height, float for #navbar.



来源:https://stackoverflow.com/questions/4451286/windows-7-explorer-in-css-layout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!