|
|
Coloring Scrollbars using CSS properties and rulesThe scrollbar-base-color is the most basic style sheet property that one can apply to a scrollbar. This property takes a color name or color code as value and displays the scrollbar in that shade. However, if you set the value for this property to a dark color, the scroll arrows might not be visible because they are displayed in black. As promised in the CSS Scrollbar color code article, let me tell you how you can change the color of the scroll arrows. The color of the scroll arrows are controlled by scrollbar-arrow-color CSS property. This property can be included in a style selector like html or can be a part of a rule that you have named. Here is a style that will set the web page scrollbar to a deep orange color and the scroll bar arrow color to white.
html {scrollbar-base-color: #FF6600; scrollbar-arrow-color: #FFFFFF;}
To check the results - click here. Now you have learnt one more style sheet property for coloring scrollbars. Here is an example of a rather gaudy scrollbar (open in a new browser window).
Note: The numbers prefixed with the hash (# sign) that you find in parenthesis after color names are hexadecimal codes of those colors. If you want to know more about hexadecimal color codes, refer Colors in HTML - web page color codes and names. Some related articles that can help you understand colors on the web: Websafe colors, Web safe colors list, Detailed list of HTML color names and List of html colour names As depicted in the image above, a scrollbar can be take in color at different places:
You can set colors for all these on a scrollbar using styles. And here are the CSS properties that govern these colors:
In the gaudy scrollbar, above, the values for these different properties have, thus, been defined in the CSS html selector as shown below:
html {scrollbar-face-color: #FF0000;
scrollbar-shadow-color: #0000FF;
scrollbar-highlight-color: #00FF00;
scrollbar-3dlight-color: #FF00FF;
scrollbar-darkshadow-color: #00FFFF;
scrollbar-track-color: #FFFF00;
scrollbar-arrow-color: #000000;}
Do the scrollbar CSS properties conform to the W3C style sheets rules - Checking CSS validity?The scrollbar CSS properties are NOT W3C valid.
Page contents: Coloring scrollbars for web sites and web pages using CSS proerpties and rules.
Page URL: http://www.webdevelopersnotes.com/tips/html/ coloring_scrollbars_using_styles_css_properties.php3
|
|