I\'m trying to get a child div to not display when it overextends its parent\'s boundaries. Like this:
div
The child div (red border)
Add overflow: hidden; to the parent div.
overflow: hidden;
#contain{ width:300px; height:200px; border:1px blue dashed; background-color:rgba(60, 10, 10, .5); padding:20px; overflow:hidden; } #big{ width:500px; height:300px; border:1px red solid; background-color:rgba(30, 30, 30, .5); }