How to fix a CSS "opacity error" ?
Asked by
mirza (
5057)
November 18th, 2007
I am getting alot of “Property opacity doesn’t exist” error messages when trying to validate the css for this Site .Any idea how to fix this? More importantly does it even matter at all since the page renders fine in most browsers?
Observing members:
0
Composing members:
0
7 Answers
It is mozilla specific. It isn’t really an error, just won’t validate.
The opacity property also works in Safari, not just Mozilla/Firefox.
is there a hack of some kind to validate it ?
I’m of the mind that validation is less important than meeting business requirements. Of course, if you have a biz requirement to use opacity and a biz requirement to validate, you’re screwed.
Ok i finally got it fixed. I don’t really know how, but theres an awesome free web tool called CleanCSS that magically fixes all your CSS errors. It is so freaking helpful
You might do a little reconsidering about what the purpose of validation is. It’s not an end in itself, and if your website functions perfectly without validating, and still has semantically meaningful markup, then validation is unnecessary. As Jeff Croft said, “Your markup validator, whether it’s the one on the W3C site or one built into your favorite coding tool, is a debugging tool [...] not a measuring stick for greatness.” I’m sure that you’ve heard about not fixing things that aren’t broken?
Your markup validator.
Or to cite an earlier article on a similar idea March to Your Own Standard
Also, there’s no way CleanCSS magically fixed your validation problem, unless it took the opacity declaration out. Check your code.
Opacity is a CSS3 technique and so will not validate yet. It works in all major browsers apart from Internet Explorer where you have to use the alpha filter instead.
Some have used tricks to apply the opacity in a way that hides it from the validator but this is pointless. Opacity will eventually be accepted so you may as well use it.
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.