当前位置:网站首页>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 .
边栏推荐
- Software design of resistance test board
- App automated testing appium Tutorial Part 1 - advanced supplementary content
- Airflow2.1.1 ultra detailed installation document
- Introduction to kubernetes (I)
- Resolution of Rac grid failure to start after server restart
- Introduction, compilation, installation and deployment of Doris learning notes
- Do you know TCP protocol (2)?
- How to insert a single quotation mark into a table as a data type in Oracle pl/sql
- SOC serial port configuration
- Activity implicit jump
猜你喜欢

redis02——一篇终结redis的五种数据类型操作命令(可学习、复习、面试、收藏备用)
![[shangpinhui] project notes](/img/aa/043dd16c20348f1f80ca5e9e4ad330.png)
[shangpinhui] project notes

Configuring MySQL multi instance master-slave synchronization for Linux

asp. Net datalist when there are multiple data displays

Jacobian matrix J commonly used in slam

Idea package together, using compact middle packages to solve &

Do you know TCP protocol (2)?

Doris学习笔记之介绍、编译安装与部署

sql主从复制搭建

小艺人黄鑫洋受邀参加巴黎时装周儿童单元武汉站
随机推荐
Reverse mapping of anonymous pages
Configuring multiple instances of MySQL under Linux
Installing MySQL under Linux
Devops foundation chapter Jenkins deployment (II)
Study notes 22/1/17
图像翻译:UVCGAN: UNET VISION TRANSFORMER CYCLE-CONSISTENT GAN FOR UNPAIRED IMAGE-TO-IMAGE TRANSLATION
About ASM disk space full, clean up ASM disk
探讨gis三维系统在矿山行业中的应用
Activity隐式跳转
Do you know TCP protocol (2)?
Doris学习笔记之介绍、编译安装与部署
ROS notes (09) - query and setting of parameters
开户券商怎么选择?网上开户是否安全么?
Is it reliable to open an account by digging money? Is it safe?
B_QuRT_User_Guide(26)
Devops Basics: Jenkins deployment and use (I)
Redis master-slave structure and application scenarios
Do you know TCP protocol (1)?
Resolution of Rac grid failure to start after server restart
Redis cluster deployment and application scenarios