Transparent DIV with CSS

This is a tip to remember quickly how to make a crossbrowser transparent DIV using CSS.

I never remember how to make a transparent DIV because there are several lines to write to get this working.

But every time I search how to do it, I discover an easier way to get it.

This is the simpliest way I have found and it is crossbrowser.


.transparent {
	filter: alpha(opacity=50);
	opacity: 0.5;


In the example the class 'transparent' is set to 50% of transparency.

Tue, Jul 3rd 2012, 09:41 | CSS, Tricks


Add New Comment

Your name:
Your e-mail:
Your web page:
I would like to receive new comment notification.
Security code: