火狐浏览器下隐藏滚动条

转载自:http://jsfiddle.net/bizamajig/md27H

原理:父元素overflow:hidden;子元素中width宽度比父元素宽,多出的宽度即浏览器滚动条的宽度

<div id=”content”>
<div id=”scrollable”></div>
</div>


#content {
position: relative;
width: 200px;
height: 200px;
border: 1px solid black;
overflow: hidden;
}
#scrollable {
height: 200px;
width: 218px;
overflow-y: scroll;
}