Create a transparent DIV
The transparent DIV in CSS
To make a transparent DIV, you can make use of the CSS techniques listed below:
Make the DIV (with the content) transparent
The div itself will be transparent, but the same aplllies for all other content such as images or text.
<div style="filter:alpha(opacity=50); opacity:0.5;">........</div>
The opacity property is taken into account in firefox 3 +, Chrome 2 +, Safari 4 and Opera 10.
The
filter:alpha(opacity=50) enables Internet Explorer 8 and Opera 9.x to make transparency.
Making transparent DIV (without the content)
Use CSS-property "rgba"
To add a color in CSS, make use the property rgb (). Soon the function
rgba() will be available . The "
a" is of course is for the transparency:
<div style="background-color: rgba(255, 0, 0, 0.5)">………</div>
Here, the color red will be transparent.
This function is not recognized by Internet Explorer nor Opera 9.x (works with Opera 10).