终于学会怎么写后台侧列表(隐藏滚动条)css
首先一个标准后台程序有三部分组成:html
如今要求以下:ide
实现和办法:spa
简单用代码来写就是:code
html,body{htm
height:100%;it
overflow-x:hidden; /*非必须*/io
}class
.topbar{后台
position:fixed; /*必须*/
}
.sidebar{
position:fixed; /*必须*/
left:0;
bottom:0; /*必须*/
overflow-x:hidden;
overflow-y:scroll;
width:270px; /*要比右侧的margin-left长*/
}
.contents{
height:100%;
margin-left:250px; /*要比左侧的宽度短*/
position:relative; /*必须*/
}
高亮再演绎一下:
html,body{ height:100%; overflow-x:hidden; /*非必须*/ } .topbar{ position:fixed; /*必须*/ } .sidebar{ position:fixed; /*必须*/ left:0; bottom:0; /*必须*/ overflow-x:hidden; overflow-y:scroll; width:270px; /*要比右侧的margin-left长*/ } .contents{ height:100%; margin-left:250px; /*要比左侧的宽度短*/ position:relative; /*必须*/ }