4 replies [Last post]
Pinago
Pinago's picture
User offline. Last seen 49 weeks 4 days ago. Offline
rank Regular
Regular
Timezone: GMT-4
Joined: 2010-02-18
Posts: 49
Points: 66

Does anyone know how to set opacity of a black background colored div to be 50% lighter, but so that the text and images that rest inside the same div are not also changed to 50% opacity? I tried the following found on w3schools, but it's still showing the text as 50% opacity along with the div...

div.transbox
{
width:400px;
height:180px;
margin:30px 50px;
background-color:#ffffff;
border:1px solid black;
/* for IE */
filter:alpha(opacity=60);
/* CSS3 standard */
opacity:0.6;
}
div.transbox p
{
margin:30px 40px;
font-weight:bold;
color:#000000;
}

Thanks!

Deuce
Deuce's picture
User offline. Last seen 4 weeks 5 days ago. Offline
rank Guru
Guru
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4421
Points: 1840

PNG. 50% transparency.

PNG. 50% transparency.

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

Pinago
Pinago's picture
User offline. Last seen 49 weeks 4 days ago. Offline
rank Regular
Regular
Timezone: GMT-4
Joined: 2010-02-18
Posts: 49
Points: 66

Thanks

Thanks Deuce. I was trying to use css and background-color, but a small square of transparent png works fine- thanks. I know IE6 reads PNGs as solid colors rather than transparent. I'll have to check to see if there is an IE6 setting to allow a png to be read correctly in IE6...

Vade
Vade's picture
User offline. Last seen 1 year 25 weeks ago. Offline
rank Enthusiast
Enthusiast
Joined: 2007-08-13
Posts: 315
Points: 276

I've used this in the past.

I've used this in the past.

Deuce
Deuce's picture
User offline. Last seen 4 weeks 5 days ago. Offline
rank Guru
Guru
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4421
Points: 1840

Bah. IE6. Progressive

Bah. IE6. Progressive Enhancements FTW!

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph