2012-02-29 52 views
0

如何在Firefox中使用自定義滾動條?我使用這一點,但沒有工作..如何在Firefox中使用自定義滾動條?

@-moz-document url("chrome://browser/content/scratchpad.xul"), 
url("chrome://stylish/content/edit.xul") { 
    scrollbar, 
    scrollbar thumb, 
    scrollcorner { 
     -moz-appearance:none!important; 
     background:none!important; 
     border:none!important; 
     min-height:9px!important; 
     min-width:9px!important; 
    } 

    scrollbar thumb { 
     background:rgba(0,0,0,.2) padding-box!important; 
     border:1px solid rgba(0,0,0,.6)!important; 
     border-radius:3px!important; 
    } 

    scrollbar thumb:-moz-any(:hover, :active) { 
     background:rgba(0,0,0,.8) padding-box!important; /* Why doesn't :active work? */ 
    } 

    scrollbar scrollbarbutton { 
     visibility: collapse !important; 
    }  
} 
+1

你們是不是要風格''元素的滾動條?這將不起作用,那裏沒有明確的''元素。你可以使用用戶代理樣式表(不是用戶樣式表)來設計該滾動條,但更可能的結果是莫名其妙的崩潰。 – 2012-03-01 06:23:49

+0

看看這裏http://forum.userstyles.org/discussion/24650/how-to-style-a-scrollbar/ – NatureShade 2013-11-26 17:37:06

回答

0

據我所知,目前還沒有一個scrollbar元素,你不能風格的滾動條與CSS(在Firefox,反正)。你從哪裏找到這個元素?

+1

使用XUL,可以訪問滾動條。我並不知道這件事。 https://developer.mozilla.org/en/XUL/scrollbar – Rob 2012-02-29 15:08:52