CSS3 do you have to declare the version?

Hi,

I have a css with css3 properties, consequently I recieve errors when I validate my code (below). Is it necessary to declare the version of the CSS in the css file? If so how do you do it?

59 #menu p La propiedad opacity no existe en CSS versión 2.1 pero existe en [css3] : 0.99
76 #menu .options La propiedad opacity no existe en CSS versión 2.1 pero existe en [css3] : 0.6
77 #menu .options Error de análisis sintáctico Opacity=60)
78 #menu .options La propiedad -ms-filter no existe : “Alpha(Opacity=60)”
107 a -moz-use-text-color no es un valor de color : -moz-use-text-color
129 #info .content La propiedad opacity no existe en CSS versión 2.1 pero existe en [css3] : 0.8
130 #info .content Error de análisis sintáctico Opacity=80)
131 #info .content La propiedad -ms-filter no existe : “Alpha(Opacity=80)”

consequently I recieve errors when I validate my code (below)

Hi,

You can’t do anything in your own CSS files to declare the version but at the w3c validator you select the level that you want to validate your files against. Click the more options link and then select the level you want to validate against.

Note that Vendor Specific extensions will not validate (such as -moz-use-text-color and IE filters).

If you want to use them you just have to live with the fact that they wont validate. Some people move these invalid rules to a new file so that the other css can be validated ok. I don;t see the point though because if you have to use them then just live with the fact that they aren’t valid. As long as you know the implications then that’s fine.

I don’t do it for the sake of being “valid” but I do see a good reason for it’s use Paul, just like with hacks and filters seperating them allows you to keep an eye on the stuff which shouldn’t be needed but is to keep the peace, if you seperate all the “nasty stuff” into a seperate file, as soon as the browser which needs them dies or gains support properly, it’s much easier to seek and destroy the redundant code. :slight_smile:

Yes that’s a good point Alex :slight_smile: