with css, can I put a div under another div without using absolute positioning?
I have these two divs, and I would like the solid white one to appear directly under the one with the yellow opacity (but not direct in the corner, at the corner of the outline).
How can this be accomplished. I’ve been experimenting with z-index and relative positioning, but to no avail.
Without using positioning, I added a style to your content div using negative margins:
Working demo here: http://jsfiddle.net/WtGsv/3/
I suggest adding an id to your
.fixed_widthdiv which houses the.contentdiv though, and using the id to give the negative margin to, that way the parent div has the negative margin, not the child div.However if you want to use absolute positioning, I have updated your jsfiddle here:
http://jsfiddle.net/WtGsv/12/
Basically, you add a parent div with
position:relative;around your other two divs that you want to useposition:absolute;