Page 1 of 1
Posted: Wed Oct 23, 2013 12:20 pm
Saw this today in the latest beta.
For this code:
Code: Select all
font:13px bolder Arial,Helvetica,sans-serif;
... CSE flagged this warning:
The following typeface was not recognized (check spelling): bolder Arial.
I had a similar warning when I used 700 for the font weight in the same position.
W3.org is a big cryptic about the order required for font declarations, but it suggests that the font size and families should be last: http://www.w3.org/community/webed/wiki/ ... rence#Font
Not sure how you want to handle this.
Posted: Thu Oct 24, 2013 7:32 pm
The spec says "font" should be "[ [ <‘font-style’> || <font-variant-css21> || <‘font-weight’> || <‘font-stretch’ ]? <‘font-size’> [ / <‘line-height’> ]? <‘font-family’> ] | caption | icon | menu | message-box | small-caption | status-bar
These values should (optionally) come before the font-size: [ <‘font-style’> || <font-variant-css21> || <‘font-weight’> || <‘font-stretch’ ]?
So the font-weight (bolder
in the code example) should come before the size (13px
), not after it. CSE HTML Validator
sees the size, then assumes the rest of the font value are font-family names.
It's an interesting situation. If CSE HTML Validator
was to generate a more specific message, then it would have to make the assumption that certain font-family names (or parts of them) are instead suppose to be something other than font-family names since it wouldn't be able to know this for sure. There could actually be a font named "bolder Arial" on someone's system.
I suppose it is something to keep in mind for a future update.
But this should be used instead:
Code: Select all
font: bolder 13px Arial,Helvetica,sans-serif;
Posted: Thu Oct 24, 2013 8:53 pm
Like I said, "not sure how you want to handle this".
The only thing you can do IMO is see if you have a number followed by "em" or "px" and check what position it's in. Like you said, anything else is a guess.
I just thought I'd mention it in case you were really, really, really bored.
Posted: Thu Oct 24, 2013 10:16 pm
RSteinwand wrote:I just thought I'd mention it in case you were really, really, really bored.
I suppose there is a slight
chance that that could happen.