View Full Version : CSS can't be validated!


Mr. Initial Man
03-25-2004, 04:44 AM
I'm having trouble validating my CSS!

body.links{
background: #000000;
color: #6677FF;
scrollbar-face-color: #0088ff;
scrollbar-highlight-color: #00ff88;
scrollbar-3dlight-color: #8800ff;
scrollbar-shadow-color: #8800ff;
scrollbar-darkshadow-color: #440088;
scrollbar-track-color: #0000FF;
scrollbar-arrow-color: #00FF00;
}
body.art{
background: #000000;
color: #FFFF00;
scrollbar-face-color: #ff8800;
scrollbar-highlight-color: #ffff00;
scrollbar-3dlight-color: #DD6600;
scrollbar-shadow-color: #FF0000;
scrollbar-darkshadow-color: #884400;
scrollbar-track-color: #884400;
scrollbar-arrow-color: #FFFF00;
}

The W3C validator says that the scrollbar stuff doesn't exist, but Lissa's CSS tutorial includes it, and it actually works! What did I do wrong?

lefty
03-25-2004, 04:55 AM
Scrollbar colors are an IE-only tag, so it'll say it's not valid even though it works [but only in IE].

pb&j
03-25-2004, 05:03 AM
try using this javascript version...

<script type="text/javascript">
window.onload = function()
{
var htmlStyle = document.getElementsByTagName('htm l')[0].style;
var bodyStyle = document.body.style;
bodyStyle.scrollbarFaceColor = htmlStyle.scrollbarFaceColor = 'red';
bodyStyle.scrollbarArrowColor = htmlStyle.scrollbarArrowColor = 'blue';
bodyStyle.scrollbarTrackColor = htmlStyle.scrollbarTrackColor = 'green';
bodyStyle.scrollbarShadowColor = htmlStyle.scrollbarShadowColor = 'gray';
bodyStyle.scrollbarHighlightColor = htmlStyle.scrollbarHighlightColor = 'yellow';
bodyStyle.scrollbar3dlightColor = htmlStyle.scrollbar3dlightColor = 'brown';
bodyStyle.scrollbarDarkshadowColor = htmlStyle.scrollbarDarkshadowColor = 'skyblue';
}
</script>

just enter your desired colors in and it should validate ok plus work too.

Mr. Initial Man
03-25-2004, 05:41 AM
2 quick questions.

1: Do I stick that script between <head></head>?
2: Can I use the hexadecimal colors in it?

pb&j
03-25-2004, 06:47 AM
1. yes.
2. i think so. havent really tested it out yet.

acsinclair
03-25-2004, 08:43 AM
Yup...the JavaScript version works with hexidecimal colors. And, it validates perfectly...which is a huge relief to me.

Hugs,
Erica

Mr. Initial Man
03-25-2004, 11:18 AM
<script type="text/javascript">
window.onload = function()
{
var htmlStyle = document.getElementsByTagName('htm l')[0].style;
var bodyStyle = document.body.style;
bodyStyle.scrollbarFaceColor = htmlStyle.scrollbarFaceColor = '#0088ff';
bodyStyle.scrollbarArrowColor = htmlStyle.scrollbarArrowColor = '#00FF00';
bodyStyle.scrollbarTrackColor = htmlStyle.scrollbarTrackColor = '#0000FF';
bodyStyle.scrollbarShadowColor = htmlStyle.scrollbarShadowColor = '#8800ff';
bodyStyle.scrollbarHighlightColor = htmlStyle.scrollbarHighlightColor = '#00ff88';
bodyStyle.scrollbar3dlightColor = htmlStyle.scrollbar3dlightColor = '#8800ff';
bodyStyle.scrollbarDarkshadowColor = htmlStyle.scrollbarDarkshadowColor = '#440088';
}
</script>

This is what I have

pb&j
03-25-2004, 01:19 PM
good show.
no problem.

Mr. Initial Man
03-25-2004, 06:58 PM
The title of that reply said it wasn't working.
I was wondering what I did wrong.

kittycat
03-25-2004, 08:57 PM
In the fourth line, make sure that there's no space in 'html'.

If it still doesn't work after that, try it without the # in front of the colours.