I keep seeing 60-80% opacity on tables on websites. They look really cool, but I'm not sure why they are doing it. Is it Javascript, or is it an image? How do I change the opacity of a table?
5
votes
6 Answers
29
votes
2
votes
IE uses the syntax filter:alpha(opacity=80), where a lower value makes the element more transparent, while Mozilla uses -moz-opacity:0.8 where a lower value has the same effect on transparency. The same things goes for the CSS3 valid syntax opacity:0.8;
So these are the three CSS properties that you need.
filter:alpha(opacity=80); //IE
opacity: 0.8; //CSS3
-moz-opacity:0.8; //Mozilla
1
votes
1
votes
You can also create a 1x1 pixel 32 bit PNG image which is for example a black square with the opacity you require. Then in your css you can do...
element
{
background: url(/Images/Transparent.png) repeat;
}
This way you can avoid all the different hacks. You may have problems with Alpha transparency in IE6 but there are ways around this also
0
votes
0
votes