核心代码:文章来源:https://www.toymoban.com/news/detail-575667.html
盒子{
overflow-y: scroll;
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
}
盒子::-webkit-scrollbar{
overflow-y: scroll;
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
}
完整代码:文章来源地址https://www.toymoban.com/news/detail-575667.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<style>
.box {
display: flex;
justify-content: center;
flex-wrap: wrap;
width: 200px;
height: 400px;
border: 1px solid red;
overflow-y: scroll;
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
}
.box::-webkit-scrollbar {
width: 0 !important
}
p{
box-shadow: 0 0 10px #e1dcdc;
width: 150px;
height: 40px;
text-align: center;
line-height: 40px;
}
</style>
<div class="box">
<p>hello world</p>
<p>hello world</p>
<p>hello world</p>
<p>hello world</p>
<p>hello world</p>
<p>hello world</p>
<p>hello world</p>
<p>hello world</p>
<p>hello world</p>
<p>hello world</p>
<p>hello world</p>
</div>
</body>
</html>
到了这里,关于移动端盒子超出部分滚动,但没有滚动条的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!