Show child element above parent element using CSS

zacharyliu picture zacharyliu · Jul 24, 2009 · Viewed 44.9k times · Source

I have two divs, one nested inside of the other. The parent element has a defined width/height. How can I show the child div above the parent (outside of it) using only CSS?

EDIT: Sorry, maybe I should clarify that I mean "above" as along the z axis. And yes, I already tried z-index. My problem is that when the child element is larger than the parent, it results in a "frame" or "window" effect, cutting off part of the div.

Answer

sixthgear picture sixthgear · Jul 24, 2009

Set overflow: visible; on the parent div.

#parent {
    overflow: visible;
}

Changed to reflect asker's update.