tags:

views:

256

answers:

2

I am a newbie to HTML and CSS and am trying to design a website, where the majority of text will be in boxes on the screen.

Each box will be coloured differently and will have more text than is visible directly

My question

Can I make the background colour of the scroll section, ie the bit between the two arrow heads match the existing background colour?

If I could even change the colour of the actual scroll bar, that would be even better

Finally, can I get rid of the horizontal scroll bar, as it is not required ? At present it makes my box have a white band along the bottom

+3  A: 

There are several soutions to change the style of scrollbars on websites:

  1. Via CSS: This doesnt work reliable: For example it works only in IE, not in firefox. So I would avoid that.

  2. Via JavaScript: I suggest: Hide the browser-scrollbars and make your own scrollbar using javascript and some arrow-images, so you got full control over the style. For example you could use JQuery and JScrollPane (demo). According to the documentation this works in all modern browsers (IE, Firefox ...). If the user would disable javascript support it would still work but the scrollbars appear unstyled.

theomega
Thanks for the quick answer(1) I have Firefox, so does that mean it can't or indeed shouldn't be done ??(2) Would the Java method work for wall browsers and if so, how
Brian
I tried to clarify my answer. Java is not the same as JavaScript! What is a Wall Browser?
theomega
Thanks a millionI'll look at those optionsI meant to refer to all browsers, ie when I upload my siteCheers !!
Brian
@Brian Unless your the only audience of this site its kind of irrelevant whether your only viewing IE, FF or Chrome, you have to code for all browsers and as theomega mentioned scrollbar styling isn't cross browser compatible. For the JS version, well this would work for anyone who has not disabled JavaScript and it works by hiding the default scrollbar and replaces it with custom images/css.
Owen
Yah, what is a "wall browser"? Curious....
o.k.w
He meant "all browsers". I just came to that!
theomega
Dang! I googled wall browser, that's 2 min of my time wasted.
o.k.w
A: 

Only Internet Explorer and Opera in quirks mode support colouring browser scrollbars, so you'll need to try a javascript solution.

Interestingly, CSS defines some system colors, so if you're (very) flexible with your design you could set the background of the scroll area to match one of those. An unlikely solution though.

For the horizontal scrollbar, you could try out overflow-x: hidden; overflow-y: scroll. That is intended to stop horizontal scrolling but allow vertical scrolling. I believe it is CSS3 so is unlikely to work in all browsers.

Update: Just saw this, which should meet your needs: http://www.leigeber.com/2009/09/javascript-scrollable-div/

DisgruntledGoat