Using RGBA to Prevent the CSS Opacity Inheritance from Parent to Child Elements

Mon, 01/07/2013 - 13:28 -- admin

Using RGBA to Prevent the CSS Opacity Inheritance from Parent to Child Elements

Today I worked on a CSS problem with opacity. Once opacity is set all children elements will also inherite the property. Nothing can be done about it.

The Solution is not to use the opacity property, rather use the background property with RGBA

the CSS for example :

#content {

background:rgb(255,255,255); /* the fall back */
background:rgba(255,255,255,0.9);

}

Use a rgb color fallback because IE7 and 8 is old school and should be sent to browser pugurtory any way.

 

 

lor fallback because IE7 and 8 is old school and should be sent to browser pugurtory any way.</p><p>&nbsp;</p><p>&nbsp;</p>