css3 - 關(guān)于滾動(dòng)條的CSS如何設(shè)置問(wèn)題
問(wèn)題描述
<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里面有一段文字,我設(shè)置了overflow:auto;也就是超出部分顯示滾動(dòng)條,那么我如何修改這個(gè)滾動(dòng)條的樣式呢?
問(wèn)題解答
回答1:一個(gè)針對(duì)Webkit內(nèi)核瀏覽器的滾動(dòng)條美化的例子,不知道是不是你想要的
/* 滾動(dòng)條部分 */::-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); }/* 手柄激活態(tài) */::-webkit-scrollbar-thumb:window-inactive { background: rgba(200,200,200,0.4); }回答2:
那就定義瀏覽器滾動(dòng)條樣式即可,兩者是一致的,如果需要不一樣,那就需要模擬滾動(dòng)條
回答3:推薦你參考這篇文章:http://www.qianduan.net/css-custom-scroll-bar-style/作者是微信團(tuán)隊(duì)的神飛,寫(xiě)的文章一直很不錯(cuò)!
回答4:話說(shuō)滾動(dòng)更改滾動(dòng)條樣式。為什么pc端可以正常顯示。手機(jī)端就不行了呢
相關(guān)文章:
1. android百度地圖定位問(wèn)題2. javascript - 關(guān)于類(lèi)的一個(gè)小問(wèn)題,求解答?3. nginx bind failed4. python - django models 為生成的html元素添加樣式。5. html5 - Chrome訪問(wèn)本地文件緩慢6. android - 有數(shù)據(jù)要處理的時(shí)候如何使用rxJava進(jìn)行異步處理數(shù)據(jù)7. javascript - 關(guān)于圣杯布局的一點(diǎn)疑惑8. android - 圖片列表分組之后復(fù)用問(wèn)題9. css3 - 這個(gè)效果用 CSS 可以實(shí)現(xiàn)嗎?border-image10. css - input間的間距和文字上下居中

網(wǎng)公網(wǎng)安備