纯css,div隐藏滚动条,保留鼠标滚动效果。

 

代码如下:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>

<style type="text/css">
ul,li,ol{padding:0;margin:0;}
.nav_wrap{height:300px;width:200px;overflow:hidden;border:1px solid #ccc;margin:20px auto;float:left;}
.nav_ul{height:100%;width:220px;overflow-y:scroll;overflow-x:hidden}
.nav_li{border:1px solid #ccc;margin:-1px;height:40px;line-height:40px;text-align:center;font-size:12px;width:200px}
.btn_wrap{text-align:center}
</style>
</head>
<body>
<div class="nav_wrap">
<ul class="nav_ul">
<li class="nav_li">我是菜单1</li>
<li class="nav_li">我是菜单2</li>
<li class="nav_li">我是菜单1</li>
<li class="nav_li">我是菜单2</li>
<li class="nav_li">我是菜单1</li>
<li class="nav_li">我是菜单2</li>
<li class="nav_li">我是菜单1</li>
<li class="nav_li">我是菜单2</li>
<li class="nav_li">我是菜单1</li>
<li class="nav_li">我是菜单2</li>
<li class="nav_li">我是菜单1</li>
</ul>
</div>
</body>
</html>

 

原创:http://blog.csdn.net/liusaint1992/article/details/51277751

posted @ 2016-09-08 17:46  堤岸信念  阅读(1063)  评论(0编辑  收藏  举报