码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2016-09-08 18:12:48      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:

技术分享 

代码如下:

<!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

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

标签:

原文地址:http://www.cnblogs.com/specialgege/p/5853925.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!