首页 > 技术文章 > css溢出滚动条及去除滚动条的方法

chao202426 2019-01-18 12:06 原文

<div class="father">
    <div class="childern"></div>
</div>

<style>
.father{display:flex;overflow:auto;}
.childern{width:200px;flex-shrink:0}
</style>

这样写滚动的时候会有滚动条出现,若想去除默认滚动条,可以加上下面这么一句

 

.father::-webkit-scrollbar{
    display: none;
}

 

推荐阅读