当前位置:网站首页>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 .
边栏推荐
- Online WPS tool
- sql分析(查询截取分析做sql优化)
- Configuring MySQL multi instance master-slave synchronization for Linux
- Airflow2.x distributed deployment DAG execution failure log cannot be obtained normally
- B_ QuRT_ User_ Guide(28)
- Reverse mapping of anonymous pages
- ROS notes (08) - definition and use of service data
- 图像翻译:UVCGAN: UNET VISION TRANSFORMER CYCLE-CONSISTENT GAN FOR UNPAIRED IMAGE-TO-IMAGE TRANSLATION
- 安装nrm后,使用nrm命令报错internal/validators.js:124 throw new ERR_INVALID_ARG_TYPE(name, ‘string‘, value)
- Redis master-slave structure and application scenarios
猜你喜欢

新唐NUC980使用记录:自制开发板(基于NUC980DK61YC)

Little artist huangxinyang was invited to participate in the Wuhan station of children's unit of Paris Fashion Week

Unity gets the coordinate point in front of the current object at a certain angle and distance

asp. Net datalist when there are multiple data displays

B_QuRT_User_Guide(27)

你了解TCP协议吗(二)?

Redis master-slave structure and application scenarios

Activity implicit jump

After installing NRM, the internal/validators js:124 throw new ERR_ INVALID_ ARG_ TYPE(name, ‘string‘, value)

Today's notes 22/1/7
随机推荐
Prometheus monitoring (I)
SOC serial port configuration
Do you know TCP protocol (2)?
同花顺注册开户靠谱吗?安全吗?
Trigonometric transformation formula
Unity - Pico开发 输入系统等相关API的使用---C#篇
Software testing and quality final review
新唐NUC980使用记录:自制开发板(基于NUC980DK61YC)
【尚品汇】项目笔记
NLP sequence can completely simulate human brain intelligence
【js】-【DFS、BFS应用】-学习笔记
微内核Zephyr获众多厂家支持!
asp. Net upload image path and image name
Ambari (VI) -- ambari API use
B_QuRT_User_Guide(29)
Study notes 22/1/17
MySQL tablespace parsing
cuda和cudnn和tensorrt的理解
[JS] - [DFS, BFS application] - learning notes
【学习笔记】搜索