VanAlbert
VanAlbert

Reputation: 2469

Google fonts API generates CSS 2.1 validation errors

Pages using the Google Font API validate as CSS3, but not as CSS2.1. Here is the href, straight out of the Google instructions:

<link href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" rel="stylesheet" type="text/css" id="googlefont" />

CSS 2.1 and XHTML 1.0 Strict are unreasonably restrictive, so I'm not against scripting workarounds when there is no workable solution (i.e. for embedding Flash video, that is, there's no other cross-browser, easily implementable solution that I know of).

Is there a workable solution, and if not, can anyone suggest a script workaround? Or should I just validate as CSS3 and call it good?

Upvotes: 1

Views: 3470

Answers (2)

Yi Jiang
Yi Jiang

Reputation: 50125

Isn't it obvious why that doesn't validate as CSS2.1?

Google Font API is using @font-face, which isn't CSS 2.1. @font-face is currently included in the CSS Level 3 Working Draft, and also in the now deprecated CSS 2 documents. It will validate if you check it against both of these specifications, but not CSS 2.1.

Upvotes: 6

Benbob
Benbob

Reputation: 14264

Here is an interesting article explaining why validation isn't everything. It's nice to do to be sure there no mistakes like orphaned tags. In reality there won't be any problems if it is valid CSS3 and doesn't validate in CSS2.1.

http://www.codinghorror.com/blog/2009/03/html-validation-does-it-matter.html

Upvotes: 0

Related Questions