views:

50

answers:

2

I'm doing a new site and getting the following error:

Property opacity doesn't exist in CSS level 2.1 but exists in : 0.5  0.5

For this chunk of CSS:

.nav-next img, .nav-previous img, #all-headers img {
 opacity: 0.5;
}

This is using the Jigsaw W3C Validator.

I see opacity in CSS3.

Am I missing something in my stylesheet, or is this a validator error, or a bit of both? And how do I fix it?

+3  A: 

The Jigsaw default validation type is for CSS2.1, as CSS3 is not a full standard yet. You just need to select CSS3 as your validation type to make sure that it doesn't come up as an error from CSS2.1.

opacity is not part of the CSS2.1 spec, as detailed here: http://www.w3.org/TR/CSS2/

Jeff Rupert
Ah, I've been using Firefox Web Developer Toolbar's "Validate local CSS" forever and it defaults to 2.1. If I use the Jigsaw site and using the more options choose 3 it works great. I hate the extra step but this works. Thanks!
artlung
You're welcome! I don't know much about the Web Dev toolbar anymore, as I've switched to Chrome, but there might be a way to set it to default CSS3. Glad to help!
Jeff Rupert
+2  A: 

you answered it by yourself... opacity is css3, the validator said is doesn't exist in 2.1. use "more options" and choose the "css level 3" to check for css3 and avoid this error.

oezi
Indeed. I wish the Jiqsaw validator had an option on their results page to revalidate with different options. Thanks for the help!
artlung