A quick follow-up to this post in which I fell victim to the moving CSS validation goal-post. Do you include a link to the W3C Validator on your site to check your mark-up and CSS for standards compliance? If so you probably tested your code against the CSS profile that was in vogue at the time. But what happens when the W3C release a new profile? They upgrade the Validator—and your CSS may go from green tick to red cross! Here's a quick tip that avoids having to re-write any CSS, but at the same time keeps you from seeing red.
Originally when I created footer.php for my site I included the following CSS validation link:
<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.bioneural.net" rel="external" title="Cascading Style Sheets">CSS</a>
My pages were valid CSS 2.0. Life was good. But something changed; the W3C began developing CSS 2.1. And I began to see red:

The W3C had started to use the draft CSS 2.1 profile as the default for its Validator. The property text-shadow isn't in the 2.1 draft, but it was there in 2.0. I happen to like this effect and wanted to retain it, so the trick is to specify that your website is complying with a specific CSS profile. This is easily accomplished by appending that profile to the URL of the link to the website you are checking, like this:
<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.bioneural.net&profile=css2" rel="external" title="Cascading Style Sheets">CSS</a>
Now, that's better:

It's a small thing, but too many little annoyances can be overwhelming!









0 responses to Overcoming CSS Validator changes