Jump to content

Div transparency


atholon

Recommended Posts

I don't think so. I think the general idea of opacity is that everything is that opacity. You could do something like...have a div with a background and an opacity, then a div with the text in on top of the other div, with an absolute position and z-index: 1. Something like that anyway.

Link to comment
https://forums.phpfreaks.com/topic/154550-div-transparency/#findComment-812676
Share on other sites

Using {opacity:1;} (because opacity is now fully supported by mozilla) won't work because it will only be 100% opacity that is inherited from the parent.

 

If by semi transparent background you mean only semi transparent background colour, then you can use:

 

{background:#000; background:rgba(0,0,0,0.5);}

 

rgba is supported by all mozilla and webkit browsers. Declare a background colour before the rgba declaration to act as a fallback for any browsers that don't support rgba. In the rgba declaration the first 3 values are the rgb values and the last is the alpha value.

Link to comment
https://forums.phpfreaks.com/topic/154550-div-transparency/#findComment-813434
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.