Can someone help me with this , div inside a div thing....thanks

Discussion in 'HTML & Website Design' started by visualkreations, Dec 23, 2007.

  1. #1
    Ok heres the problem...

    I have a DIV that has a background image. then inside that DIV i have a DIV that has a background color. but that background color on the inside DIV is over lapping the background image on the outside DIV , is it possible to make the background image on the outside div go on top of the background color of the inside div?
     
    visualkreations, Dec 23, 2007 IP
  2. sri

    sri Active Member

    Messages:
    917
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    70
  3. manishk

    manishk Peon

    Messages:
    63
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    :confused: Why are you using two divs? If you can post your code or show an example page then maybe I can help you.
     
    manishk, Dec 24, 2007 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Sure. Use one div, give it both a background colour and the image. Easier.

    element {
    background: #f00 url(image.jpg) no-repeat;
    }

    Though it depends on the reason why you had two divs in the first place... if you must have two, we can figure out other ways to make the page look the right way.
     
    Stomme poes, Dec 24, 2007 IP
  5. Crimsonc

    Crimsonc Peon

    Messages:
    616
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #5
    indeed, you have a div inside another and it's background color is on top of the background image, thats just basic structure. If you don't want the internal div's background to overlap the image why give it a background color at all?

    It's confusing! I think if we could see it we could help you out quickly.
     
    Crimsonc, Dec 24, 2007 IP