iNET Interactive - Online Advertising Agency
          
   Home    Authors    About    Login    Contact Us
   Search:   
Advanced Search     
  Articles

  ASP (26)
  ASP.NET (19)
  C and C++ (4)
  CFML (2)
  CGI and Perl (16)
  Flash (2)
  Java (7)
  JavaScript (28)
  PHP (92)
  MySQL (13)
  MSSQL (3)
  HTML (34)
  SEO (9)
  Visual Basic (12)
  CSS (13)
  SSI (5)
  XML (12)
  C# (14)

  Developer News

May 17, 2008
Learn HTML forms
About
 
May 16, 2008
Who Are Your Top Friends on Facebook?
About
 
May 15, 2008
Reader Question - Would you host your client's work on your website?
About
 
May 15, 2008
How to Create an Ajax Autocomplete Text Field: Part 6
WebReference.com
 
May 14, 2008
Poll: Are the browser safe colors still needed?
About
 
May 14, 2008
Google Doctype launched
About
 
Courtesy of moreover.com
 
Want to receive new articles via e-mail? Click here!
/Home /CSS

CSS Scrollbars 

  Views:    10559
  Votes:    7
by Jack Carr 12/14/03 Rating: 

Synopsis:

Ever seen those coloured scroll bars on pages and wondered how you do them? Well here's how.
Pages: 
The Article

NOTE: THESE SCROLLBARS ONLY WORK IN IE 5.5 AND ABOVE

CSS Scrollbars??
What am I talking about? You've probably seen a web site, where someone has their scrollbars using
the same color scheme as their design - looks good doesn't it! Well here's how to do it..

Set up the style sheet
OK, I presume you have read, or at least skimmed my basic styles web design tutorial, so I'm not going
to explain how it works again. Right then, open your html file, and put

 <link rel="stylesheet" type="text/css" href="yourfile.css">

after the <head> tag. Now, open up your style sheet, (yourfile.css) and insert the following code :

body {
scrollbar-face-color: #DEECEF;
scrollbar-shadow-color: #FFFFFF;
scrollbar-highlight-color: #DEECEF;
scrollbar-3dlight-color: #DEECEF;
scrollbar-darkshadow-color: #000000;
scrollbar-track-color: #DEECEF;
scrollbar-arrow-color: #000000;
 

Explanation
Whoa! quite a mouthful i know, but most of the elements are pretty self-explanatory,
scrollbar-face-color for example, sets the color of the scrollbar face on your web site
(the main section of the scrollbar) and scrollbar-track-color sets the color of the track
of the scrollbar - the area of the screen it runs on - experiment with the color values
and all will become clear!

Result
Now then if you followed my instructions correctly, you should have a coloured scrollbar. To change the background color,
see my basic styles web design tutorial - hopefully you see the usefulness of this technique,
one word of warning though - you can really spoil a page if you use this incorrectly!

Pages: 



 
  Sponsors