分享工作总结
在工作中遇到需要去除滚动条,滚动条的所在影响了页面的美观度。在网上搜集资料,看到了这样一个简便的方法,总结下来与其分享。
CSS如何实现隐藏滚动条
兼容IE、 Firefox浏览器
<div class="first"> <div class="second"> <div class="content"> ...... </div> </div> </div> .first,.third { width: 200px; height: 200px; }
.first {
position: relative;
overflow: hidden;
}
.second {
position: absolute; left: 0;
overflow-x: hidden;
overflow-y: scroll;
}
/* for Chrome */
.second::-webkit-scrollbar {
display: none;
}