HTMLGoodies
The ultimate html resource
Earthweb.com


About the Double-Underlined Links


Become a Partner




Search Clipart.com:



internet.commerce















HTML Goodies : Beyond HTML : Cascading Style Sheets: Scroll Bar Colors

HTML GOODIES TO GO NEWSLETTER


Other Related Newsletters

Scroll Bar Colors


By Joe Burns

...use these to jump around or read it all
[The Main Document Scrollbar] [The Textarea Scrollbar] [The Scroll Color Commands]

So. Do you like my scrollbar?

I've found that most users don't like scrollbars all that much. Most would rather click and go from page to page, but scrollbars are part of the Web and differing screen sizes make it nil to impossible to never attain a scroll bar.

I ran across only one of these CSS commands while surfing my University's Web site. The Webmaster had placed them on the homepage to get a nice green scroll. That's one of the school's colors. I liked the effect so, without asking him, I grabbed the code. He reads this site, so I'm going to wait until he writes me a letter calling me a thief.

What's overly cool about these commands is that they work on browsers that understand them, IE 5.5 and above at the moment, yet don't throw errors on those that do not. That's a pretty good deal. You can go ahead and plop these on your page and not worry about any cross-browser concerns.

Furthermore cool regarding these commands is that they not only affect the main browser scroll, but any scroll that appears through form elements or iframe tags.

Moreover cool is that you can affect each scrollbar separately.

Lastly cool is setting the main command to the same color as the background of the page so that the scroll basically disappears except for the little button the user moves up and down.

End of statements involving the word, "cool".


The Main Document Scrollbar

I got the effect on the document's main scrollbar; the one on the far right, using a style block in the HEAD tags of the document. It looks like this:

<STYLE TYPE="text/css">

BODY
{
scrollbar-base-color: orange;
scrollbar-arrow-color: green;
scrollbar-DarkShadow-Color: blue;
}
</STYLE>

Now that you see the code, look to the right and pick out what each element does. You may need to look rather closely to find the effect of the scrollbar-base-color command. Hint: look closely at the border around the arrow and moveable button.

Hey! That was a lousy hint. It basically told you the answer.


The Textarea Scrollbar

Before I get into any further explanation, I wanted to show you a Textarea box with a colorful scrollbar. I made it using inline STYLE attributes. Dig this:

And here's the code:

<FORM>
<TEXTAREA COLS="10" ROWS="10"
STYLE="scrollbar-base-color:pink;scrollbar-arrow-color:purple;">
Text in the box
</TEXTAREA>
</FORM>


I changed up the colors a little to show that, as with all CSS commands, the commands closest to the element win. That's why the inline commands in the Textarea box overrode the commands that altered the main scroll on the far right. If I didn't override the main commands the colors would have simply been transferred to the Textarea box. I'll prove that to you now. Here's a Textarea box that doesn't have any inline elements. Note that it looks like the scrollbar on the far right.


The Scrollbar Color Commands

Up above I gave you a couple of examples. You can take the format for using the commands from there also. Here I'd like to simply show you each of the commands and what they do through the use of a Textarea form element. You can use these commands in tandem as you've seen above.

You'll need to go to a new page so that I can isolate the effect from the style sheets commands that already appear on this page.

See the effects here


That's That

Use them all and make some really terrible scrollbars, or use them wisely and you can make a scrollbar that actually compliments the work that you do.

As always, these are Style Sheet commands so be very careful of the capitalization. It matters.

 

Enjoy!

 

[The Main Document Scrollbar] [The Textarea Scrollbar] [The Scroll Color Commands]

Tools:
Add htmlgoodies.com to your favorites
Add htmlgoodies.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

IT Management Networking & Communications Web Development Hardware & Systems Software Development Earthwebnews.com



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Service Component Architecture Enabling XML Web Services for Java Programmers
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Intel Article: Using Power & Display Context in the Intel Mobile Platform SDK
Internet.com eBook: Real Life Rails
IBM SCA Center Article: Simplifying Composite Applications with Service Component Architecture
Intel PDF: Quad-Core Impacts More Than the Data Center
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Intel PDF: Analysis of Early Testing of Intel vPro in Large IT Departments
Internet.com eBook: Best Practices for Developing a Web Site
Intel PDF: IT Agility through Automated, Policy-based Virtual Infrastructure
IBM CIO Whitepaper: The New Information Agenda. Do You Have One?
Microsoft Article: BitLocker Brings Encryption to Windows Server 2008
IBM Whitepaper: Service Component Architecture & Java EE Integration
Microsoft Article: RODCs Transform Branch Office Security
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
Avaya Article: Advancing the State of the Art in Customer Service
IBM Whitepaper: How are other CIOs driving growth?
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Avaya Article: Avaya AE Services Provide Rapid Telephony Integration with Facebook
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Download: IBM WebSphere Application Server V7.0 Feature Pack for Service Component Architecture
Actuate Download: Free Visual Report Development Tool
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
IBM SCA Download: Start Building SCA Applications Today
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES