当前位置: 首页 > news >正文

网页、h5默认滚动条样式重构


文章目录

  • 前言
  • 一、使用步骤
    • 1、在想要滚动的元素上设置相应的css类名
    • 2.设置样式
  • 总结


前言

此文章用于,让我自己快速设置 浏览器、h5 默认滚动条样式……


一、使用步骤

1、在想要滚动的元素上设置相应的css类名

代码如下:

<div class="list scroll-container"><p>…………</p><p>…………</p>…………
</div>

2.设置样式

代码如下:

/* 容器样式 */
.list{height: 500px; /* 记住一定要设置高度哦!*/
}/* 滚动条样式 */
.scroll-container {  overflow: hidden;  overflow-y: auto;  
}  
.scroll-container::-webkit-scrollbar-track-piece {  background-color: rgba(0, 0, 0, 0);  border-left: 1px solid rgba(0, 0, 0, 0);  
}  
.scroll-container::-webkit-scrollbar {  width: 5px;  height: 13px;  -webkit-border-radius: 5px;  -moz-border-radius: 5px;  border-radius: 5px;  
}  
.scroll-container::-webkit-scrollbar-thumb {  background-color: rgba(0, 0, 0, 0.2);  background-clip: padding-box;  -webkit-border-radius: 5px;  -moz-border-radius: 5px;  border-radius: 5px;  min-height: 28px;  
}  
.scroll-container::-webkit-scrollbar-thumb:hover {  background-color: rgba(0, 0, 0, 0.2);  -webkit-border-radius: 5px;  -moz-border-radius: 5px;  border-radius: 5px;  
} 

该处使用的url网络请求的数据。


总结

以上就是今天的内容,三Q!

http://www.lryc.cn/news/355509.html

相关文章:

  • 香橙派AIpro测评上手指南
  • GBDT 算法【python,机器学习,算法】
  • 软考 系统架构设计师系列知识点之SOME/IP与DDS(3)
  • 将AI大模型装进你的手机,你愿意么?
  • 前端面试题12-22
  • 【论文解读】Performance of AV1 Real-Time Mode
  • java处理中文脱敏
  • 【Linux网络】端口及UDP协议
  • Unity 生成模版代码
  • 【ai】chatgpt的plugin已经废弃
  • 2024年03月 Python(四级)真题解析#中国电子学会#全国青少年软件编程等级考试
  • 多旋翼无人机机场考哪些内容?
  • 【前端每日基础】day23——箭头函数
  • 27.Java中单例模式的实现方式
  • C#面:当一个线程进入一个对象的方法后,其它线程是否可以进入该对象的方法?
  • express框架下后端获取req.body报错undefined
  • Element plus 低版本弹窗组件添加拖拽功能
  • 计算机组成原理易混淆知识点总结(持续更新)
  • 【STM32踩坑】HAL固件库版本过高导致烧录后无法运行问题
  • 芯片丝印反查
  • C语言之指针详解(5)(含有易错笔试题)
  • discuzX2.5的使用心得 札记一
  • 【Python】 探索Django框架的高并发处理能力
  • C-数据结构-平横二叉树
  • 算法训练营day41
  • cesium开发实例分享
  • 字符串和字符串函数(1)
  • 基于springboot+vue的班级综合测评管理系统
  • 蓝海项目揭秘:跨境选品师的崛起与挑战
  • 酷黑简洁大气体育直播自适应模板赛事直播门户网站源码