css3隐藏滚动条

css yekong 531℃

chrome 和Safari

.element::-webkit-scrollbar { width: 0 }

IE 10+

.element { -ms-overflow-style: none; }

Firefox

.element { overflow: -moz-scrollbars-none; }

公共class

在需要隐藏滚动条的div上追加一个hideScrollBar就可以了


.hideScrollBar::-webkit-scrollbar {
  width: 0
}

.hideScrollBar {
  -ms-overflow-style: none;
  overflow: -moz-scrollbars-none;
}
喜欢 (1)