Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

51 users online



No Scrollbar colors in XHTML?

No Scrollbar colors in XHTML?

Currently viewing this thread: 1 (0 members and 1 guests)


Page 1 out of 3
Ron

Ron

Status: Offline!

No Scrollbar colors in XHTML?

I am currently redesigning my site with XHTML and CSS, and I'm trying to add scrollbar colors. have they been taken out?
My codes don't seem to be working... I'm using XHTML strict doctype

fredmv

fredmv

Status: Offline!

The CSS for scrollbar colors is proprietary IE code, it's not even in the specification.

___________________

http://home.comcast.net/~fredv4/tf/firefox.gif

Karo

Karo

Status: Offline!

sorta off-topic, but check this out ;

http://codephobia.com/tutorials/view.php3?idnum=1

___________________

trUe - kar0o*

Michael2003

Michael2003

Status: Offline!
Quote:

Originally posted by Fred
The CSS for scrollbar colors is proprietary IE code, it's not even in the specification.


It works in Konqueror as well I believe, and as it isn't valid CSS really (unless I am mistaken), I think that you can use a Javascript document.write to make it validate well.

Also, if you do use DHTML, you run into problems with non-Javascript enabled browsers, so just how worth it doing that is, is up for debate.

fredmv

fredmv

Status: Offline!
Quote:

Originally posted by Michael2003
It works in Konqueror as well I believe


I've heard that as well and I tested it for myself and it didn't seem to work.

___________________

http://home.comcast.net/~fredv4/tf/firefox.gif

Michael2003

Michael2003

Status: Offline!
Quote:

Originally posted by Fred
I've heard that as well and I tested it for myself and it didn't seem to work.


Well, I just did a quick test, and it does work, but it seems to be a bit pickier than IE for some reason. What works in IE doesn't necessarily seem to work Konqueror, but I definitely got it to work. If you want a quick code that works to just see it on, try this:

Code:

<style type="text/css">

<!--

BODY

{
scrollbar-face-color:#0000ff;
scrollbar-arrow-color:#000000;
scrollbar-track-color: #ff00ff;
scrollbar-shadow-color:#00ff00;
scrollbar-highlight-color:#5e3ba2;
scrollbar-3dlight-color:#ffffff;
scrollbar-darkshadow-color:#ff0000;
}

-->

</style>


Granted, that looks horrible with those colours, but if it isn't just my browser being funny, then it should look different to usual, instead of just plain. Also, I just read that coloured scrollbars work on Opera 7.0+, though I have absolutely no idea if this is true or not, but if anyone has this, then it would be interesting to know what happens.

fredmv

fredmv

Status: Offline!

Interesting tests Mike, I think it may not have worked under Konqueror because I was using it under an XHTML 1.0 Strict DOCTYPE when I was testing it. I also just tested your exact code under Opera 7.21, it didn't seem to work.

___________________

http://home.comcast.net/~fredv4/tf/firefox.gif

Michael2003

Michael2003

Status: Offline!
Quote:

Originally posted by Fred
Interesting tests Mike, I think it may not have worked under Konqueror because I was using it under an XHTML 1.0 Strict DOCTYPE when I was testing it. I also just tested your exact code under Opera 7.21, it didn't seem to work.


Hmm, strange, I made a valid XHTML 1.0 Strict page (I even checked with the validator), and it showed coloured scrollbars in my version of Konqueror (version 3.1.0 I believe). CSS wasn't valid mind, so that would have to be fixed if it were to be used on a webpage. But not working Opera wouldn't surprise me really. Hmm, strange...

webarnes

webarnes

Neverside Newbie
Status: Offline!

here is my js hack. I've posted it here several times in the past.
And this is my take on it:
The scroll bar css is invalid css and only displays in limited browsers. So if you're an ie junkie and gotta have it then bury it in a js hack and it is a win / win situation.
Since it is not in your css file the css validates.
Since it is ie only all other browsers will ignore it
If js is turned off there is no love lost. They didn't want to see you're pretty scrollbar anyhow. Tongue

As far as validation of the xhtml goes: The scroll bar will only display in a browser that supports it anyway such as internet explorer, neo planet and maybe Konqueror? This should work regardless of doctype.

So here you go:
Just place it in your external js file and call into head of document.

document.write('<'+'style type="text\/css">'+
'body {'+
'scrollbar-3dlight-color : #000;'+
'scrollbar-arrow-color : #000;'+
'scrollbar-base-color : #000;'+
'scrollbar-darkshadow-color : #000;'+
'scrollbar-face-color : #FFE7D1;'+
'scrollbar-highlight-color : #000;'+
'scrollbar-shadow-color : #F65726;'+
'scrollbar-track-color : #94999F;'+
'}'+
'<\/style>');

William

___________________

http://webarnes.globalwebtech.com/images/zerolarge.gif

Last edited by webarnes, November 4th, 2003 12:24 AM (Edited 1 times)

Rad

Rad

thinking of something witty to put here
Status: Offline!

That's great, but, it kind of ruins the standards concept.

Page 1 out of 3
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0092 seconds.