Search code examples
htmlcssparent

Show child element above parent element using CSS


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.


Solution

  • Set overflow: visible; on the parent div.

    #parent {
        overflow: visible;
    }
    

    Changed to reflect asker's update.