scriptygoddess

10 Jun, 2002

Quick reference for changing scrollbar color

Posted by: amy In: Lessons learned

Every now and then, I run across bits of code that I simply cannot make stick in my head, no matter how hard I try to make it happen. For me, one of my worst problems was remembering which CSS property controlled each portion of the scrollbar.

I loved having pretty, properly-shaded scroll bars, but every time I sat down to do a design, I couldn't remember which property was which.

So, I made a little cheat sheet.

Here's the little text bit I have saved on my desktop that helps me remember what colors to put in each property.

(Stating the obvious: this goes in your stylesheet.)

BODY  {
scrollbar-base-color: MEDIUM;
scrollbar-face-color: MEDIUM;
scrollbar-track-color: BACKGROUND;
scrollbar-highlight-color: LIGHT;
scrollbar-3dlight-color: MEDIUM;
scrollbar-shadow-color: DARK;
scrollbar-darkshadow-color: MEDIUM;
scrollbar-arrow-color: DARK;
}

The illusion of three dimensions is created by three colors — a light, a medium, and a dark — arranged together in a specific way. 'Background' is meant to be whatever the page's current background color is.

…and suddenly I found myself spending a lot less time on scrollbars. I'm all about that sort of thing. Lazy is good!

11 Responses to "Quick reference for changing scrollbar color"

1 | Brad

June 10th, 2002 at 8:14 pm

Avatar

It's funny what does and doesn't stick in our heads isn't it. I always have problems with this too and and usually just do away with it 'cause I couldn't be bothered. But now, there's now excuse :-)

Thanks!

2 | Jennifer

June 10th, 2002 at 8:58 pm

Avatar

That is very helpful!!! Cool! :)

3 | Row

June 10th, 2002 at 9:19 pm

Avatar

Laziness produces great things.

And if you revert the light and dark, you get a nice backwards effect which can be quite striking.

I use a program called 'cool web scrollbars' but installing it gave me a chunk of spyware. It has a preview screen which I find useful, among other things..

4 | girlie

June 13th, 2002 at 9:42 pm

Avatar

Nifty little thing to have on hand! Thanks!! =)

5 | Tricia

June 15th, 2002 at 1:51 pm

Avatar

I have a Macintosh, so of course I can't see any pretty-pretty scrollbars, and I just got advised about them less than 6 months or so ago, and it ha been pretty difficult for me to figure out how they would look without screenshots and advice from peecee users lol…so this, I think, will help me quite a bit thanks!!

6 | NEOPHOBIA

July 31st, 2002 at 1:29 pm

Avatar

ok, thats nice, its good to have that so i can remeber what to write, i just need some help now on where to put it, i have no idea and i think im just messing up my test website trying to change it.

7 | Marc

August 18th, 2002 at 2:34 pm

Avatar

I managed to squeeze a little tool out today that could be of some help in generating the ccs for your scrollbars. It only works in Internet Explorer 5.5 and up though (sorry Netscape users) Hope it works for you all. (please give it time to load) http://www.braincast.nl/samples/scroll/

8 | armina

November 1st, 2002 at 3:48 am

Avatar

wow.. really simple and impressive hacks :-)

9 | tekneek

November 1st, 2002 at 2:47 pm

Avatar

Will the style work in an external linked style sheet or does it have to be included in each page?

10 | jane

January 15th, 2003 at 5:29 pm

Avatar

hi there,
I tried to do this with my stylesheet, and it doesn't work when I load my page. Here is the body code

body {margin:0px 0px 0px 0px;
background: #B0D4DE;
scrollbar-base-color: #6495ED;
scrollbar-face-color: #6495ED;
scrollbar-track-color: #B0D4DE;
scrollbar-highlight-color: #F0F8FF;
scrollbar-3dlight-color: #6495ED;
scrollbar-shadow-color: #000080;
scrollbar-darkshadow-color: #6495ED;
scrollbar-arrow-color: #000080;
}

Could there be something wrong with the browser I am using? I am on IE and I can see others' fancy scrollbars. I usually miss something obvious, so hopefully that's the case this time. :)
Thanks!

11 | Anonymous

March 15th, 2003 at 11:22 am

Avatar

I just spend the last couple of hours trying to figure out why my scrollbars looked so lovely while I was developing my page, but now that I'm finished, they're gone. This is very important, so listen closely.

Colored scrollbars only work in IE 5.5+

I found that right away, but this is what took me so long:

Regardless if you're using HTML or XHTML, if you use a Transitional DOCTYPE, the scrollbar styles should be applied to the body tag. If you're l33t like me, and you use a Strict DOCTYPE, you absolutely MUST apply the scrollbar styles to the HTML tag. Hope that helps somebody. :)

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements