14 replies [Last post]
allmagica
Offline
Regular
Last seen: 15 years 4 weeks ago
Joined: 2005-09-08
Posts: 29
Points: 0

Hi,

My css is valid but I get some warnings.

- Do warnings indicate errors that are not real errors?

- "You have no background-color with your color : #header" I have no background color because I have a background image. I cant have a background color as well, can I?

I have 2 more warnings I cant understand:

- " Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the name are ignored and any sequence of whitespace characters inside the name is converted to a single space. : body"

- "Same colors for color and background-color in two contexts .content a:visited and li a:hover"

:?:

BladeMetal
Offline
newbie
Last seen: 16 years 30 weeks ago
Joined: 2006-01-17
Posts: 5
Points: 0

Warnings related to validation

Well, instead of specifying a background color, you can set it like this:

background-color: transparent;

BladeMetal
Offline
newbie
Last seen: 16 years 30 weeks ago
Joined: 2006-01-17
Posts: 5
Points: 0

Warnings related to validation

Ok, i understand this one:

E.g. you have:

font-family: times new roman;

This is incorrect syntax.

When font names have spaces you should write:

font-family: "times new roman";

allmagica
Offline
Regular
Last seen: 15 years 4 weeks ago
Joined: 2005-09-08
Posts: 29
Points: 0

Warnings related to validation

Unfortunately that doesnt work, I already tried it. It still gives the same warning.

allmagica
Offline
Regular
Last seen: 15 years 4 weeks ago
Joined: 2005-09-08
Posts: 29
Points: 0

Warnings related to validation

BladeMetal wrote:
Ok, i understand this one:

E.g. you have:

font-family: times new roman;

This is incorrect syntax.

When font names have spaces you should write:

font-family: "times new roman";

If I use " " then it completely changes the way my fonts are displayed. :? Crying And why is it incorrect without the " "? It still validates :?: questions over questions Laughing out loud

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 31 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Warnings related to validation

CSS warnings have been covered at length on the forum, please do a search.

Yes you can and should declare a background with your image e.g:
background: #fff url(image.gif);

These warnings are accessibility level 1 warnings and are intended to let you know that you may have a problem that needs attending to, you must decide whether you have covered the reasons for requiring backgrounds and colours to be declared in pairs (check out the WCAG for detail) it is not always possible or desirable to declare both though.

The quote reference is telling you what is required 'Quote marks' you must enclose values that contain white space with quote marks as in font family declarations where you might use 'trebuchet ms'

The last one is pointing out a possible conflict you need to apply judgment as to whether it's a problem.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

allmagica
Offline
Regular
Last seen: 15 years 4 weeks ago
Joined: 2005-09-08
Posts: 29
Points: 0

Warnings related to validation

Whoops, I think I got it now.. I must place the " " around only one font not around them all Laughing out loud Laughing out loud Laughing out loud I ll try it out and report Laughing out loud.

BladeMetal
Offline
newbie
Last seen: 16 years 30 weeks ago
Joined: 2006-01-17
Posts: 5
Points: 0

Warnings related to validation

Ok Laughing out loud, its always something small...

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 44 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Warnings related to validation

allmagica wrote:
Whoops, I think I got it now.. I must place the " " around only one font not around them all Laughing out loud Laughing out loud Laughing out loud I ll try it out and report Laughing out loud.

The quote marks are for font names that contain more than one word, e.g. Trebuchet MS, Times New Roman, Lucida Grande all require quote marks, whereas Verdana, Arial and Georgia do not.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 31 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Warnings related to validation

BladeMetal 'transparent' is not a colour, the accessibility warnings are for a specific reason and transparent doesnt cut it as a solution, it will still issue the warning.

allmagica what do you mean "completely changes" you are probably now using this font for the first time ? what fonts have you declared, do you have a generic font family declared as well?

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

allmagica
Offline
Regular
Last seen: 15 years 4 weeks ago
Joined: 2005-09-08
Posts: 29
Points: 0

Warnings related to validation

Hugo wrote:

allmagica what do you mean "completely changes" you are probably now using this font for the first time ? what fonts have you declared, do you have a generic font family declared as well?

Hugo.

I used courier new and Trebuchet MS along with san-serif as a generic font at the end. It "completely changed" because I was putting the quotes like that "courier new, trebuchet ms, sans-serif"
which was obviously competely wrong... Now that I put the quotes around each font it works Smile "courier new", "trebuchet ms", sans-serif Smile

A great deal of warnings went away with this. Now I have to figure out the background thing. Maybe I ll just set one background-color and hope that the background image will override it.

allmagica
Offline
Regular
Last seen: 15 years 4 weeks ago
Joined: 2005-09-08
Posts: 29
Points: 0

Warnings related to validation

Hugo wrote:
CSS warnings have been covered at length on the forum, please do a search.

Yes you can and should declare a background with your image e.g:
background: #fff url(image.gif);

These warnings are accessibility level 1 warnings and are intended to let you know that you may have a problem that needs attending to, you must decide whether you have covered the reasons for requiring backgrounds and colours to be declared in pairs (check out the WCAG for detail) it is not always possible or desirable to declare both though.

The quote reference is telling you what is required 'Quote marks' you must enclose values that contain white space with quote marks as in font family declarations where you might use 'trebuchet ms'

The last one is pointing out a possible conflict you need to apply judgment as to whether it's a problem.

Hugo.

Am I blind? I didnt see your posting a minute ago. Sorry. Thanks everyone a lot for your help.

allmagica
Offline
Regular
Last seen: 15 years 4 weeks ago
Joined: 2005-09-08
Posts: 29
Points: 0

Warnings related to validation

I couldnt find something related to this by using the search:

Line : 19 (Level : 2) Redefinition of margin-top : body

Its the only warning now in my document!

padding:0; 
margin:0; 
margin-top: 0px;

Something not quite right?

Edit: I removed the margin-top testing it and it didnt make any difference. The warnings are now completely gone. Smile

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 16 weeks 2 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

Warnings related to validation

It's telling you you've defined something more than once.

Not entirely sure why you did that Laughing out loud

Verschwindende wrote:
  • CSS doesn't make pies

allmagica
Offline
Regular
Last seen: 15 years 4 weeks ago
Joined: 2005-09-08
Posts: 29
Points: 0

Warnings related to validation

Laughing out loud I also dont know how I was thinking when I wrote that :oops: such things happen because I dont know the css very well. In fact I have learned most of it just by experimenting and trying out "logical" values or by looking at other peoples css.. :roll: