Transparency and Opacity

Is there anyway I can show a gray semi-transparency over any elements with a certain class (”disabled”)?

.disabled {
background-color: #666;
width: 100%;
height: 100%;
-moz-opacity: 0.7;
opacity: 0.7;
filter: alpha(opacity=70);
}

The first rule provides opacity levels in Gecko based browsers (Camino, Firefox, SeaMonkey), the second to Safari (and Opera I think), and the third is an IE specific one, which I suspect is not valid code, but which works.

Comments

Topics: Web |