css实现隐藏滚动条
demo1:
html
<div class="outer-container"> <div class="inner-container"> <div class="content"> ...... </div> </div> </div>
css
.outer-container,.content { width: 200px; height: 200px; } .outer-container { position: relative; overflow: hidden; } .inner-container { position: absolute; left: 0; overflow-x: hidden; overflow-y: scroll; }
demo2
直接在css中用伪属性
::-webkit-scrollbar
.element::-webkit-scrollbar {display:none}
博客中所涉及到的图片都有版权,请谨慎使用