- 话不多说,直接上代码,例:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.box{
width: 300px;
height: 300px;
border: 4px solid #000;
overflow: auto;
}
.box>div{
width: 1000px;
height: 100%;
border: 1px solid red;
font-size: 50px;
}
/*去除移动端浏览器滚动条:*/
.box::-webkit-scrollbar{display:none}
</style>
</head>
<body>
<div class="box">
<div>去除移动端浏览器滚动条</div>
</div>
</body>
</html>
去除移动端浏览器滚动条的重点是这行代码:
.box::-webkit-scrollbar{display:none}