Thursday, 15 March 2012

html - How to place a child div behind the parent div? -


My question is exactly the same as I say, I have tried it down, but it does not work.

My HTML

  & lt; Div id = "parent" & gt; & Lt; Div id = "children" & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

My CSS

  #parent {status: relative; Z-index: 2; Width: 200px; Height: 200 pixels; Background: green; } # Child {status: complete; Z-index: 1; Width: 100px; Height: 100 pixels; Background: blue; }  

The default element's z-index And then give the child a negative z-index .

By doing so, you are essentially removing the element that was established between the elements first.

  #parent {place: relative; Width: 200px; Height: 200 pixels; Background: green; } # Child {status: complete; Z-index: -1; Width: 100px; Height: 100 pixels; Background: blue; }  

No comments:

Post a Comment