Click to See Complete Forum and Search --> : Opacity validation CSS 2.1


B-Twien Bytes
09-25-2007, 04:13 PM
Hello all,

I try to get my CSS-sheet validated (CSS 2.1 or higher), but the opacity seems to give problems.

Looked in other threads, but could not really get THE solution.

Here is the part of my CSS...


#content {
background-color:#ffffff;
filter: alpha(opacity=90); /* needed for IE */
opacity: 0.9;
float: right;
width: 20em;
height: 23.8em;
padding: 0.5em;
font-family: Georgia,"Courier New",serif;
font-size: 0.8em;
overflow: auto;
}


The website this is used for is: http://www.maliwood.com

Thanks for the input!

drhowarddrfine
09-25-2007, 04:43 PM
opacity is a css3 property but the validator is not set up for that just yet. You may use it in modern browsers but, of course, not IE.

B-Twien Bytes
09-25-2007, 04:55 PM
Thanks for the info!

So just use it the way it is....or use another code, which give the same effect?

Kravvitz
09-25-2007, 05:35 PM
Just use it the way it is.

drhowarddrfine
09-25-2007, 11:16 PM
Yup.

Jeff Mott
09-25-2007, 11:57 PM
Just to clarify that while CSS3 does include an "opacity" property, that's not what B-Twien is using. He's using a "filter" property. "filter" is not CSS3. It's an IE-only property.

B-Twien, one of the nice features of CSS is that browsers must ignore properties they don't understand. So IE will read the filter declaration, and every other browser will happily skip it, just the way you'd want.

And remember that validation is a tool, not a goal. The validator will help you find mistakes. But since we know filter isn't a mistake, we can ignore that validation error.

drhowarddrfine
09-26-2007, 09:29 AM
He uses both.

Jeff Mott
09-26-2007, 09:34 AM
Ahh... you're right. I read too quickly. Sorry.

B-Twien Bytes
09-26-2007, 06:09 PM
Thanks all for your replies, input: appreciated!!

B-Twien is a she by the way ;)

Jeff Mott
09-26-2007, 10:25 PM
B-Twien is a she by the way ;)lol, sorry. I had a 50/50 shot. Maybe I'll be luckier next time. :P