CSS的一些常用样式,如背景、文字、文本、表格、列表等,以及一些常用的场景,如居中对齐、溢出、隐藏元素等。01、常用样式 1.1、background背景 设置元素背景的样式 background,更
顺晟科技
2021-08-27 11:55:11
128
1.改变浏览器默认的滚动条样式
::-webkit-scrollbar-track-piece { //滚动条凹槽的颜色,还可以设置边框属性 background-color:#f8f8f8; } ::-webkit-scrollbar {//滚动条的宽度 width:9px; height:9px; } ::-webkit-scrollbar-thumb {//滚动条的设置 background-color:#dddddd; background-clip:padding-box; min-height:28px; } ::-webkit-scrollbar-thumb:hover { background-color:#bbb; }
2.给某个div .test1加滚动条样式
.test1::-webkit-scrollbar { width: 8px; } .test1::-webkit-scrollbar-track { background-color:red; -webkit-border-radius: 2em; -moz-border-radius: 2em; border-radius:2em; } .test1::-webkit-scrollbar-thumb { background-color:green; -webkit-border-radius: 2em; -moz-border-radius: 2em; border-radius:2em; }
09
2022-11
30
2022-09
18
2022-09
15
2022-09
15
2022-09
15
2022-09