Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS div inside div

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #31124
    misterade
    Member

    Hello everybody, I’m new to this forum and I have a question for you.
    I need to do something like this:
    1) the first div has shadow and black background with alpha 40%;
    2) the second div is inside the first and I want it to have white background.
    the problem is that the second div inherit the alpha property.
    How can I do what I want?

    #68088
    clokey2k
    Participant

    Rather than setting the ‘div’s opacity (which I think you have done), set the background colour using ‘rgba()’ or use a semi transparant ‘.png’.
    The latter option will the most cross browser compliant, with the assistance of a ‘png fix’ for IE.

    A quick Google search can get you some good tutorials on rgba() or transparent png’s.

    #68091
    Chris Coyier
    Keymaster

    This has a color of black with an opacity of .5, get it?

    background-color: rgba(0,0,0,.5);
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.