css代码:
.nav_wrap{
height:400px;
width:200px;
overflow:hidden;
border:1pxsolid#ccc;
margin:20pxauto;
}
.nav_ul{
height:100%;
width:220px;
overflow-y:auto;
overflow-x:hidden;
}
.nav_li{
border:1pxsolid#ccc;
margin:-1px;
height:40px;
line-height:40px;
text-align:center;
font-size:12px;
width:200px;
}
.btn_wrap{
text-align:center;
}
html代码:
<divclass="nav_wrap">
<ulclass="nav_ul">
<liclass="nav_li">我是菜单1</li>
<liclass="nav_li">我是菜单2</li>
</ul>
</div>
之前的一个项目中的菜单用到了这个技巧。那个项目用了iframe。也是让滚动条被遮住了。
今天又顺手把目前在做的项目中的导航菜单的滚动条去掉了。简单总结下来


本文转载自中文网


本文转载自中文网
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css3-style/c56589.shtml