css溢出滚动条及去除滚动条的方法

<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;
}

 

posted @ 2019-01-18 12:06  超哥20  阅读(6879)  评论(1编辑  收藏  举报