2016-07-28 162 views
0

嗨,大家可以帮助我这段代码不适合我我不知道为什么。你能建议我的textarea滚动条属性的任何代码。textarea滚动条不工作

<textarea style="scrollbar-arrow-color:pink; 
        scrollbar-base-color:red; 
        scrollbar-darkshadow-color:blue; 
        scrollbar-highlightcolor:orange; 
        scrollbar-shadow-color:green"> 
    </textarea> 
+0

[CSS滚动条式跨浏览器]的可能的复制(http://stackoverflow.com/questions/7725652/css-scrollbar-style-cro ss浏览器) –

+0

http://jsfiddle.net/5GCsJ/954/在这里检查。 – Ranjan

回答

0

你正在做错的方式。内联样式属性只能包含属性声明,不能内联声明伪元素。 因此,请尝试在样式表中编写您的CSS并将其链接到您的页面。

这些是一个textarea伪构件

::-webkit-scrollbar    
::-webkit-scrollbar-button  
::-webkit-scrollbar-track   
::-webkit-scrollbar-track-piece 
::-webkit-scrollbar-thumb   
::-webkit-scrollbar-corner  
::-webkit-resizer 

一个简单的例子可以是:

::-webkit-scrollbar { 
    width: 12px; 
} 

::-webkit-scrollbar-track { 
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
    border-radius: 10px; 
} 

::-webkit-scrollbar-thumb { 
    border-radius: 10px; 
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); 
} 

::-webkit-scrollbar { 
 
    width: 12px; 
 
} 
 
    
 
::-webkit-scrollbar-track { 
 
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
 
    border-radius: 10px; 
 
} 
 
    
 
::-webkit-scrollbar-thumb { 
 
    border-radius: 10px; 
 
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); 
 
}
<textarea id="message" rows="4" cols="50"> </textarea>