Sets the opacity of an element and its children. Doesn't validate. Mozilla began supporting the opacity rule in version 1.7, so '-moz-opacity' may not be necessary...
selector { filter: alpha(opacity=60); /* MSIE/PC */ -moz-opacity: 0.6; /* Mozilla 1.6 and older */ opacity: 0.6; }
Comments
Subscribe to comments
You need to login to post a comment.

As a note, I believe, Gecko 1.7 was implemented in Firefox 1.5.
Firefox 1.5 uses gecko 1.8 Firefox 1.0 uses gecko 1.7 So anything older then firefox 1.0 does not support opacity
Hi, In general I like the Idea of snippets, no doubt about that! But I would love to see some kind of standardilzation of them, preferable in a combination of XML, XSD (schema). You could then transform your XML snippet to what ever purpose you would need it in - say a HTML context. You can validate the input to the snippet using XSD. And some clever programmer might create add-ins for say MS Visual Studio 2008 or other commenly used development tools.
Here is my first thoughts about how it could be put together - based on this snippet for opacity:
Sorry the system didn't like me pasting XML into the comment field... I try again: Hi, In general I like the Idea of snippets, no doubt about that! But I would love to see some kind of standardilzation of them, preferable in a combination of XML, XSD (schema). You could then transform your XML snippet to what ever purpose you would need it in - say a HTML context. You can validate the input to the snippet using XSD. And some clever programmer might create add-ins for say MS Visual Studio 2008 or other commenly used development tools. Here is my first thoughts about how it could be put together - based on this snippet for opacity: Opacity hack 1.0 CSS { filter: alpha(opacity=); / MSIE/PC / -moz-opacity: ; / Mozilla 1.6 and older / opacity: ; }
Sorry - I simply couldnt make my comment containing XML example. So I wrote an article on my blog: http://netsi1964.blogspot.com/ - feel free to read it :-)
This method does not validate but surely works.. cool with hovers.
To make CSS validate, it is better to set Opacity from JS for older browsers.
i use jquery $(selector).css('opacity','.6')
yeah, but this has the same effect. it triggers the css in the described way, so why not just use css? :)
http://css3please.com/ :)
@almazom:
Don't try to fix things with JavaScript, websites should function properly with it. JavaScript is merely an enhancement, and should be used as such.
100% crossbrowser hack: .class { filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.5; }
from http://css-tricks.com/css-transparency-settings-for-all-broswers/
Use
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50);
As a fall back for IE
The right column says "355 people have marked this snippet as a favorite". How do I mark a snippet as a favorite?!?! I have been trying to do this... for months. I don't see the button anywhere on the interface. Thank you. I'm really looking forward to an answer from someone. Thank you in advance!!!!