Jump to content

CSS Validation Help


SillyBilly

Recommended Posts

I ran my style sheet through the validator and I don't understand the errors.1. My scrollbar property and colors are not recognized as valid

body {scrollbar-base-color: #fafad2;scrollbar-track-color: #000000;scrollbar-shadow-color: #ffd700;scrollbar-3dlight-color: #ffd700;

The error for all of the above is Property scrollbar-base-color doesn't exist : #fafad2 2. This another error that confuses me

body {background-color: black;background-image: url("pictures/blackmarble3.gif");font-family: helvetica, verdana, arial, sans-serif;color: #FFFFCC;font-size: 11pt;margin: 1em 0.5em 1em 0.8em;}a:link {color: #FF0000;}a:visited {color: #0FF000;}a:hover {color: #FF00FF;}a:active {color: #00FFFF;}

The error isLine : 22 (Level : 1) You have no background-color with your color : a:link Line : 25 (Level : 1) You have no background-color with your color : a:visited Line : 28 (Level : 1) You have no background-color with your color : a:hover Line : 31 (Level : 1) You have no background-color with your color : a:active I put the background color as black in case the gif does not display.I have colors for my links. The Validator gives the following as the correct code

body {background-color : black; background-image : url("pictures/blackmarble3.gif"); font-family : helvetica, verdana, arial, sans-serif; color : #ffffcc; font-size : 11pt; margin : 1em 0.5em 1em 0.8em; } a:link {color : #ff0000; } a:visited {color : #0ff000; } a:hover {color : #ff00ff; } a:active {color : #00ffff; }

This code looks like mine.Any comments or suggeations would be appreciated.

Link to comment
Share on other sites

Ok, for the first part I believe that W3 doesn't like changing scroll bars, and I'm not ven sure it they make them valid anymore. Does it work, though? If it doesn't work then there is a logical solution somewhere. The second problem is one that I've had before too. The solution I used was to use the background property in the definition of each part of the link properties, i.e.:a:active {color: #00FFFF;backgground-color:#000;}Try using "tansparent" to keep you bg image undisturbed.~Aphotic

Link to comment
Share on other sites

For #1...quote from msdn

This property is a Microsoft extension to CSS
In other words
Property scrollbar-base-color doesn't exist
I would imagine that if you remove the line containing "scrollbar-base-color" you will then get an error about the next line#2 It is actually a warning, but... You should have a background color defined if you define color. Works the other way around, too. I'm sure you can be resourceful enough to figure out how to work a search engine and find reasons why... In your case, you know that the links will inherit the background color from the body element, so you don't nee d to worry about it. So a recap... #1 is an error because you are trying to use an MS extension which is not part of standard CSS - you will need to get rid of it if you want to follow standards. #2 is a warning about an accessibility issue - you can ignore it if you like.
Link to comment
Share on other sites

For #1...quote from msdnIn other wordsI would imagine that if you remove the line containing "scrollbar-base-color" you will then get an error about the next line#2 It is actually a warning, but... You should have a background color defined if you define color. Works the other way around, too. I'm sure you can be resourceful enough to figure out how to work a search engine and find reasons why... In your case, you know that the links will inherit the background color from the body element, so you don't nee d to worry about it. So a recap... #1 is an error because you are trying to use an MS extension which is not part of standard CSS - you will need to get rid of it if you want to follow standards. #2 is a warning about an accessibility issue - you can ignore it if you like.

Thank you to aphotic and sbrownii.  I feel much better now.  I suspected the first one after reading other articles and posts.  As to the second one, I was at a loss since both codes work well in IE.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...