1 reply [Last post]
kiwis
kiwis's picture
Offline
Enthusiast
Last seen: 2 years 4 weeks ago
Timezone: GMT+13
Joined: 2009-03-07
Posts: 65
Points: 102

I want a parent DIV as a container.

In that I want a DIV with a black background with a opacity of .60. I then want everything in that DIV to not adopt the .60 opacity.

How can I do this?

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 day 13 hours ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9745
Points: 3824

background-color

CSS3 allows you to set the background color's opacity. For example,

div {
  background-color: #000;  /*for browsers that don't support bg opacity*/
  background-color: rgba(0,0,0,.6);
  }

Older IEs require their proprietary filter. I don't use them, so try Google or maybe someone else will chime in.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.