久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術文章
文章詳情頁

css3 - 關于滾動條的CSS如何設置問題

瀏覽:114日期:2023-07-26 14:27:12

問題描述

<p id=’p3’ style=’width:200px;height:200px;overflow:auto;’>This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text. </p>

就像上面代碼 p里面有一段文字,我設置了overflow:auto;也就是超出部分顯示滾動條,那么我如何修改這個滾動條的樣式呢?

問題解答

回答1:

一個針對Webkit內核瀏覽器的滾動條美化的例子,不知道是不是你想要的

/* 滾動條部分 */::-webkit-scrollbar { width:15px;}/* 軌道 */::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); -webkit-border-radius: 15px; border-radius: 15px;}/* 手柄 */::-webkit-scrollbar-thumb { -webkit-border-radius: 15px; border-radius: 15px; background:rgba(200,200,200,0.7); -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); }/* 手柄激活態 */::-webkit-scrollbar-thumb:window-inactive { background: rgba(200,200,200,0.4); }回答2:

那就定義瀏覽器滾動條樣式即可,兩者是一致的,如果需要不一樣,那就需要模擬滾動條

回答3:

推薦你參考這篇文章:http://www.qianduan.net/css-custom-scroll-bar-style/作者是微信團隊的神飛,寫的文章一直很不錯!

回答4:

話說滾動更改滾動條樣式。為什么pc端可以正常顯示。手機端就不行了呢

標簽: CSS
相關文章:
主站蜘蛛池模板: 江安县| 宿州市| 长岛县| 社旗县| 股票| 乐昌市| 普宁市| 东乡| 昌吉市| 芦山县| 莱州市| 科尔| 溆浦县| 柘荣县| 通道| 井研县| 平湖市| 江川县| 东海县| 梁平县| 房产| 双峰县| 白河县| 乌拉特前旗| 新河县| 确山县| 四川省| 荔波县| 兴海县| 秦皇岛市| 化州市| 惠州市| 洪江市| 天峨县| 潜江市| 牡丹江市| 定日县| 邻水| 济宁市| 满城县| 白河县|