有多种方法,一个是给父盒子固定高度,然后超出隐藏,子 盒子开启滚动条
子盒子:
第二种,
给App.vue里面的类选择器添加
* ::-webkit-scrollbar {
width: 0.1em;
background-color: transparent;
}
::-webkit-scrollbar-thumb {
background-color: transparent;
}
可以取消浏览器的滚动条,也可以加在容器身上
如:
给容器添加id,然后
#content{
overflow-y: auto;
::-webkit-scrollbar {
width: 0.1em;
background-color: transparent;
}
::-webkit-scrollbar-thumb {
background-color: transparent;
}
width: 100%;
margin-right: auto;
display: flex;
}