문제

Call me a rube, but I want my work to validate. 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). So, 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?

Thanks,

motorhobo

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top