当前位置:网站首页>Hidden scroll bar on PC
Hidden scroll bar on PC
2022-06-28 08:13:00 【Mediocrity and laziness】
In setting up the overflow:auto Using pseudo element selectors on elements of ::-webkit-scrollbar, See the following examples for specific use
<style type="text/css">
.li-group {
width: 500px;
height: 300px;
border: 1px solid red;
overflow-y: auto;
}
.li-group::-webkit-scrollbar {
display: none
}
li {
width: 100%;
height: 50px;
}
</style>
</head>
<body>
<ul class="li-group">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
</ul>
</body>
If you need to be compatible with other browsers, you can use the following method
.outer-container,.content {
width: 200px; height: 200px;
}
.outer-container {
position: relative;
overflow: hidden;
}
.inner-container {
position: absolute; left: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.inner-container::-webkit-scrollbar {
display: none;
}
<div class="outer-container">
<div class="inner-container">
<div class="content">
......
</div>
</div>
</div>
In essence, it is to put another one on the outermost layer overflow:hidden Box , The size of the inner content is the same as that of the outer nested box .
边栏推荐
- Eslint 语法监测关闭
- Installing MySQL under Linux
- Redis cluster deployment and application scenarios
- After installing NRM, the internal/validators js:124 throw new ERR_ INVALID_ ARG_ TYPE(name, ‘string‘, value)
- PLSQL installation under Windows
- Study notes 22/1/19 and 22/1/20
- 同花顺注册开户靠谱吗?安全吗?
- Chenglian premium products donated love materials for flood fighting and disaster relief to Yingde
- 关于如何在placeholder中使用字体图标
- 【学习笔记】差分约束
猜你喜欢

Redis master-slave structure and application scenarios

Introduction to Devops Basics

【学习笔记】拟阵

asp. Net to search products and realize paging function

Trigonometric transformation formula

Jenkins' common build trigger and hook services (V)

MySQL implements transaction persistence using redo logs

Do you know TCP protocol (2)?

Unity 获取当前物体正前方,一定角度、距离的坐标点

探讨gis三维系统在矿山行业中的应用
随机推荐
安装nrm后,使用nrm命令报错internal/validators.js:124 throw new ERR_INVALID_ARG_TYPE(name, ‘string‘, value)
Helloword routine for ROS
【学习笔记】最短路 +生成树
The RAC cannot connect to the database normally after modifying the scan IP. The ora-12514 problem is handled
SLAM中常用的雅克比矩阵J
22/02/14 study notes
Resolution of Rac grid failure to start after server restart
asp. Net datalist when there are multiple data displays
Soft exam -- software designer -- afternoon question data flow diagram DFD
Ambari (VIII) --- ambari integrated impala document (valid for personal test)
Prometheus service discovery
Configuring multiple instances of MySQL under Linux
Oracle view tablespace usage
Prometheus monitoring (I)
Leetcode swing series
The maximum number of Rac open file descriptors, and the processing of hard check failure
In flood fighting and disaster relief, the city donated 100000 yuan of love materials to help Yingde
Jacobian matrix J commonly used in slam
Installing mysql5.7 under Windows
B_QuRT_User_Guide(26)