| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Magazines™
Join Date: Mar 2003
Location: Glasgow..
Posts: 11,263
|
css validation
css validates correctly but warnings * Line : 2 Level : 1 You have no color with your background-color : body * Line : 12 Level : 1 You have no background-color with your color : #top * Line : 23 Level : 1 You have no color with your background-color : #banner * Line : 35 Level : 1 You have no background-color with your color : ul * Line : 45 Level : 1 You have no background-color with your color : li * Line : 51 Level : 1 You have no background-color with your color : li a * Line : 75 Level : 1 You have no background-color with your color : #link1 * Line : 84 Level : 1 You have no background-color with your color : #link2 * Line : 93 Level : 1 You have no background-color with your color : #link3 * Line : 101 Level : 1 You have no background-color with your color : #link4 * Line : 109 Level : 1 You have no background-color with your color : h1 * Line : 116 Level : 1 You have no background-color with your color : h2 * Line : 116 Level : 1 Same colors for color and background-color in two contexts #banner and h2 * Line : 116 Level : 1 Same colors for color and background-color in two contexts li a:hover and h2 * Line : 123 Level : 1 Same colors for color and background-color in two contexts #banner and h3 * Line : 123 Level : 1 You have no background-color with your color : h3 * Line : 123 Level : 1 Same colors for color and background-color in two contexts li a:hover and h3 does anyone fill this crap in. probably worth it longterm |
|
|
|
|
|
#5 (permalink) |
|
Dr. Lucien Sanchez
Join Date: Mar 2003
Location: UK
Posts: 5,625
|
It's up to you (it's your site), but I wouldn't advise it. It'll just bulk up your stylesheet. Remember it's automated - it picks up elements without background colours, for example, when they don't need one. "Line : 2 Level : 1 You have no color with your background-color : body" This first one is because you have shorthand css. You used background: #colour, but it looked for background-color:#colour. As I said: bollocks. This is the important bit: Congratulations! This document validates as CSS! |
|
|
|
#15 (permalink) | |
|
trouble free and loverlee
Join Date: Mar 2003
Location: YooKay
Posts: 2,874
|
Quote:
Firstly, if you already have background#fff then the validator won't be warning about absent backgrounds, so there's no need to repeat the declaration in the verbose form. (I just used the verbose form in the example to be clear what I was getting at and to avoid overriding any background-image attributes that may be set in those declaration blocks. The shorthand background: ...; attribute will override/clear all verbose background attributes that precede it, even if the values in the verbose attributes are not mentioned in the shorthand attribute. Clear as mud. Secondly, as long as I have already implemented a background (colour) for the body, then I don't always bother to clean up warnings (unless there's just one or two). It's usually only a matter of pasting the line into a few paces in the css and the css validates warning free. Filesize isn't really a concern as correcting something like Mike's original example would only add an extra 100-300 bytes to the css file, depending on how you did it. Once the body background (colour) is set then the background/foreground colour behaviours become much more predictable in untested situations. However, you'd be surprised to see just how many web-developers/designers still forget to set their body background. Try changing your browser default background to a non-white colour and browse around for a bit and you'll see what I mean. -- Of course, there's always the asterisk selector to fall back on. It won't get rid of the validation warnings, but it will go a a fair way to addressing the usability concerns that the validator warnings are reminding you about. (It is likely, as the validator becomes more intelligent, that the presence of the asterisk selector will be accounted for when assessing whether or not warnings should be given.) |
|
|
|
|
#16 (permalink) |
|
Magazines™
Join Date: Mar 2003
Location: Glasgow..
Posts: 11,263
|
i agree it wouldn't ake me long to change them. and i will for the final version i suppose it does help more whne you are using other style sheets to allow the user to change apperance of your page - it does give you alot more options |
|
|
|
#17 (permalink) | |
|
Dr. Lucien Sanchez
Join Date: Mar 2003
Location: UK
Posts: 5,625
|
Quote:
The stylesheet for gds began: "body { background: #1E2D3B;..." The validator said: "* Line : 2 Level : 1 You have no color with your background-color : body" Ten days to come up with this and I still don't follow you. |
|
|
|
|
#18 (permalink) | |
|
trouble free and loverlee
Join Date: Mar 2003
Location: YooKay
Posts: 2,874
|
The validation warning states that there is no (foreground) color to accompany the declared background (color). Quote:
Either you're getting a little mixed up or you're not making your point very clear. I am aware that my first post here will not resolve all of the warnings in Mike's post, but I assumed people here would be able to carry the idea through and implement the correct form for each of the warnings. |
|
|
![]() |