为了能到远方,脚下的每一步都不能少.|

CSS实现滚动条隐藏

  1. 使用伪元素:::-webkit-scrollbar
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
.content {
width: 200px;
height: 100px;
background-color: pink;
overflow-y: scroll;
margin: 20px auto;
text-align: center;
}
.content::-webkit-scrollbar {
display: none;
}
</style>
</head>
<body>
<div class="content">
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
<p>7</p>
<p>8</p>
<p>9</p>
<p>10</p>
</div>
</body>
</html>

本文作者:Morita-desin

本文链接:https://www.cnblogs.com/yqquinn/p/17763634.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Morita-desin  阅读(37)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起