View Full Version : Scrollbar appearance, CSS and DOC TYPE

12-07-2006, 04:51 PM
I've noticed that when I try to define the scrollbar appearance, it only works when the DOC TYPE is not specified or html transitional. If I specify the DOC TYPE as XHTML transitional then the scrollbar colours don't change. Why is this happening and how do I get the scrollbar colours to display irrespective of the DOC TYPE?


12-07-2006, 04:53 PM
You need to apply them to the html element as well

html, body {
/*scrollbar color stuff*/
FYI scrollbar colors only work in IE.

12-07-2006, 05:38 PM
thanks for your help...it's a nice visual bonus for IE users I think. Any particular reason why it has not been implemented by other browsers?

12-07-2006, 05:44 PM
Because there is this theory that web developers shouldn't mess with the users browser controls. Its always been a microsoft thing. Opera I believe allows its users to allow scrollbar colors to work.

12-07-2006, 06:43 PM
I suppose that this theory doesn't apply to web designers :)

12-07-2006, 08:06 PM
Not messing with the userís browser controls is in part an accessibility issue; for example, Iíve seen some web designers make the scroll‐bar virtually one color such that you couldnít tell what the scroll position was or where the scroll position bar was. Another reason for their lack of implementation is probably because the scroll‐bar properties are proprietary to Microsoft and not part of any of the W3Cís CSS specifications.

I did a quick test with Opera 9 about two weeks ago and was only able to get those CSS properties to work while Opera was in quirks mode, so Iím not sure if you can get them to work in that browserís standards‐compliance mode.