tags:

views:

37

answers:

2

Call me a rube, but I want my work to validate. Pages using the Google Font API validate as CSS3 but not 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

A: 

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

Keyo
I totally agree, thanks for the amusing link. Still, some clients see validation as a quality measure. One agency here won't hire you unless the sites in your portfolio validate. Like I said, I have no problem scripting around it in extreme cases, but since the W3C validator defaults to CSS2.1, I'd like to find a workaround for the Google Fonts API/CSS2.1 validation issue.
motorhobo
You should provide a link to a newer validation engine perhaps. By the way you can now use html5 and the xhtml validation passes as html5. I don't know why they don't do the same for css. Failed 2.1, Passed 3.0 or something like that.
Keyo
Although you make a valid point, that validation isn't everything, that isn't the problem here. The problem is that the OP is trying to validate his code against the wrong version of the specifications. Also, pointing to Jeff's blog for advice on how to write good HTML and CSS probably isn't the best idea, given how bad SO's HTML is.
Yi Jiang
+1  A: 

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.

Yi Jiang
That is the answer I was looking for, thanks. That should have been obvious perhaps, but I guess I missed it. Imho it borders on absurd how these standards are determined, it really makes a travesty of the entire concept of validation in the real world.
motorhobo
BTW I would vote this answer up but I don't have sufficient reputation yet.
motorhobo
@motohobo On Stack Overflow, if an answer solved your problem, you can accept it, which is independent from voting, and can be done regardless of reputation. Just click on the green checkmark beside each answer.
Yi Jiang
Done, thanks...looks like I have reputation now too.
motorhobo