Styling the Browser Scrollbars

There is a way to style the scrollbar of the browser, it is not the best practice and it’s not supported by all browsers. I’ve used it with inline CSS frames and inline frames. Let’s say you have a div like this:

...
<div id="inline-frame">
    <p>Some text goes here ... put more text to see the effect</p>
</div>
...

And the CSS code is:

#inline-frame {
    overflow: auto;
    width: 200px;
    heigth: 200px;
    scrollbar-face-color: #eee;
    scrollbar-arrow-color: #ddd;
    scrollbar-track-color: #ccc;
    scrollbar-shadow-color: '';
    scrollbar-highlight-color: '';
    scrollbar-3dlight-color: '';
    scrollbar-darkshadow-color: '';
}

This would work with on IE5.5 and up. Firefox doesn’t support that because changing the browser is messing with the clients preferences and shouldn’t be a ‘style’ setting. But you can do it with Javascript if you really need it, but remember some people are visually impaired and have specific settings for their GUI and you’ll be messing with it.

Here is the Javascript solutions for Firefox and other browsers not supporting the above method.

Leave a Reply


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


  Subscribe to our RSS Feed   Follow us on Twitter

You've arrived on the "Advanced CSS/HTML Explained" weblog. Here you will find how can you tackle the more difficult topics of Cascading Style Sheets: Floating theory, Forms, Tables, Navigation elements, CSS Positioning. Also you will find lots of Resources, Tutorials, Articles, and Tips, Tricks Tools, and Techniques on CSS.

Recent Posts

Categories

Twitter Updates

Bookmark and Share