coloured scroll bars

tania721's picture

They have: 39 posts

Joined: Aug 2001

You know the coloured scroll bars that are around (ie. at http://www.graphic-forums.com/)....say for example I'm using tables, and I have a text area in the middle of my screen, can a coloured scroll bar be applied to that text area only? If so, any hints as to how to go about it?

Later, T
Laughing out loud

`Imagination is more important than Knowledge' ~ Albert Einstein

detox's picture

They have: 571 posts

Joined: Feb 2001

you can achieve this with a textarea, keep in mind that it is only ie compatible though. You cannot make specific changes to fonts etc, however you can define a default text area font bg color etc. have a look at this, keep in mind that the code editor often cuts off the end of bits of code we post here, so it might be missong the closing body and html tags.

You would be much better off using a div etc and creating your own scrollbars. That too is not cross browser totally though.

anyway, try this out:

<?php
 
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">

<html>
<head>
    <title>Untitled</title>
</head>
  <style type=\"text/css\">
.textbox    
        {font-family: Verdana,'Comic Sans MS',Arial,Sans-Serif,

Helvetica;font-size: 10px;
    border: 1px solid; background:#B6C6C9 ;
scrollbar-base-color: #B6C6C9;
scrollbar-3dlight-color:#B6C6C9;
           scrollbar-arrow-color:Black;
           scrollbar-darkshadow-color:#B6C6C9;
           scrollbar-face-color:#B6C6C9;
           scrollbar-highlight-color:#B6C6C9;
           scrollbar-shadow-color:#B6C6C9}</style>
<body bgcolor=\"#2D5986\">

<textarea cols=\"60\" rows=\"20\" name=\"fred\" class=\"textbox\" onFocus='this.blur()'>Rogue Market lets its members stay ahead of the curve of public opinion by giving them news from columnists who specialize in the latest rumor, gossip and speculaltion. And it lets them interact with each other through a number of features and
community tools.The result is a community that embraces its players

in a unifying fiction. And it's a fiction that lets them win prizes.


How Does It Work
The concept is simple. Players register at the site for a free account with $10,000 in play money. They then begin investing in the
1500 celebrities listed on the site. If the price of a celebrity rises they make a profit, if the price falls they make a loss. The objective is to make a profit so that you can build up your portfolio and start to redeem some of your profits for prizes.

Who Plays the Rogue Market
Hundreds of thousands of players have registered to The Rogue Market.
Together they generate millions of page views per month. The site's
audience ranges from 18 years old and up. But the majority of the members are 18-40, and about 65% male / 35% female


How Does It Work
The concept is simple. Players register at the site for a free account with $10,000 in play money. They then begin investing in the 1500 celebrities listed on the site. If the price of a celebrity rises they make a profit, if the price falls they make a loss. The objective is to make a profit so that you can build up your portfolio and start to redeem some of your profits for prizes.

Who Plays the Rogue Market

Hundreds of thousands of players have registered to play The Rogue
Market. Together they generate millions of page views per month. The
site's audience ranges from 18 years old and up. But the majority of
the members are 18-40, and about 65% male / 35% female
</textarea></div>


</body>
</html>
?>

Enigmatic's picture

They have: 44 posts

Joined: Oct 2001

The code above is great sample.

Try also these CSS generators - http://www.cgiscript.net/site_javascripts_generators.htm

Also, you may want to put your CSS style code into separate file and call it from within each file:

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

That will save you time when updating/chaning the style code for the entire site.

Best,

Enigmatic

EvenHost.com <- Professional and Affordable Web Hosting Solutions

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

You could build a class in your stylesheets like Detox shows or do something like this:

textarea {
        scrollbar-base-color: #
scrollbar-track-color: #;
scrollbar-face-color: #;
scrollbar-highlight-color: #;
scrollbar-3dlight-color: #;
scrollbar-darkshadow-color: #;
scrollbar-shadow-color: #;
scrollbar-arrow-color: #;
background-color : #;
}
Body {
scrollbar-base-color: #;
scrollbar-track-color: #;
scrollbar-face-color: #;
scrollbar-highlight-color: #;
scrollbar-3dlight-color: #;
scrollbar-darkshadow-color: #;
scrollbar-shadow-color: #;
scrollbar-arrow-color: #;
background-color : #;
}
'
Note that you can even change the background color if you want. I have tried in the past to put an image in the textarea by background-image : url(image.gif); but Netscape won't load the box at all in this case.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

Busy's picture

He has: 6,151 posts

Joined: May 2001

Am I not holding my tongue right or something? I checked on IE5 and Net6 but couldnt/have never seen any coloured scroll bars, I know how its done, but have never seen it on the web

dazed and confused

detox's picture

They have: 571 posts

Joined: Feb 2001

ALWAYS have your stylesheet in a separate file. I only showed it inline as I needed to display the definitions.

I would have to say in all fairness that there are better (cross browser )ways of accomplishing this however.... But the simple fact is, usually there is no pareto optimal way of displaying info on the web. Until standards are accepted and implimented the same way, we poor developers will have to deal with an imperfect world.

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Busy, the colored scrollbars appeared on IE 5.5. I don't know yet if they work on Netscape. I know that they don't as of Netscape 4.78. They do have some limited support in Opera 5.11 though. I personally hate colored scrollbars but I use them on occasion. Mostly I use them to make the scrollbar disappear by making everything the same as the background color except for the arrow.

To get stuff to work cross-platform is about as hard sometimes as finding the post reply button in this thread.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.