开发者

Google fonts API generates CSS 2.1 validation errors

开发者 https://www.devze.com 2023-01-20 13:35 出处:网络
Pages using the Google Font API validate as CSS3, but not as CSS2.1. Here is the href, straight out of the Google instructions:

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?


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消