CSS2.1 validation fails for font-weight
-
24-05-2021 - |
Вопрос
In the CSS2.1 standard, I see that font-weight
exists:
http://www.w3.org/TR/CSS21/fonts.html#font-boldness
But I get the following errors while validating:
50 h2 Value Error : font-weight 600 is not a font-weight value : 600
53 h5 Value Error : font-weight 900 is not a font-weight value : 900
95 div#logo Value Error : font-weight 600 is not a font-weight value : 600
470 .contactInfoLink a Value Error : font-weight 800 is not a font-weight value : 800
Why?
Решение
Ignore it. It's a valid value. There is probably a bug in the CSS validation software somewhere. The most notable one I've received: Parse Error [empty string]
. Isn't that just a lovely and detailed error? Anyways, these errors sprout up on occasion. There's not really anything we can do about them.
Другие советы
It is apparently a bug the the W3C CSS Validator, probably rather recent. It seems to report all numeric values for font-weight
as errors. I have filed a bug report:
http://lists.w3.org/Archives/Public/www-validator-css/2012Mar/0015.html
I am experiencing the same problem as well; a google of the error I was receiving brought me to this question. I happen to be experiencing not only Parse Error [empty string]
, but also the font-weight
issue, and also a validator issue with word-wrap
that says break-word
doesn't exist.
The break-word
bug is confirmed here. It sounds like the bug is quite old.