How to place div over two divs?

Discussion in 'CSS' started by Mentalhead, Oct 10, 2010.

  1. #1
    I have a problem that is related to three divs.
    I want to do something like on this picture bellow, and I have no idea how to do it, so
    any help and suggestion would be highly appreciated.
    Here's the pic:
    [​IMG]
    As for the positioning, I'm trying to use position: relative on all divs, because absolute positioning messes up my layout.
    Basically, Float Right on the picture contains text, and all I want to do is to place it over those two divs.
    I used the negative margin-top on my Float Right box without any z-index to get it over the upper block element, but I can't get it over the bottom block element.
    Actually, I did manage to put the Float Right div over the bottom block element by using the negative margin-top on bottom block element, and it managed to do the trick, but then background image from Float Right div dissipated equal to the value of negative margin-top that is mentioned above.
    I don't know what to do, so I'm hoping that you'll be able to help me out a bit.
     
    Mentalhead, Oct 10, 2010 IP
  2. GWiz

    GWiz Peon

    Messages:
    359
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Without you providing any kind of code it is difficult to provide you with helpful advice.
     
    Last edited: Oct 10, 2010
    GWiz, Oct 10, 2010 IP
  3. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Do the boxes have fixed heights? You could have just one box, with a background image that looks like two boxes, and the floated box in the middle of two paragraphs.
    Only the text in the bottom paragraph wraps around the floated box, which makes it hard to get it right in the middle.

    Another way is to have two paragraphs inside each box, with one being less than full width. Then you just absolutely position a box over the gap.
     
    Cash Nebula, Oct 11, 2010 IP
  4. jmiles

    jmiles Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think you can do it using the z-index css property. assign z-index css values to each divs.
     
    jmiles, Oct 11, 2010 IP
  5. o3harris

    o3harris Active Member

    Messages:
    124
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #5
    set float right with highest z-index & use margin to position your float right div
     
    o3harris, Oct 16, 2010 IP