minnirok
asked on
parent div crop child div
Hi,
How can we have a parent div clip contents of children divs without scrollbars appearing:
<html>
<body>
<div id = "parent" style = "position:absolute; left:20px; top:20px; width:100px; height:100px; border:1px solid black;">
<div id = "child" style = "position:absolute; left:20px; top:20px; width:100px; height:100px; border:1px solid red;">
</div>
</div>
</body>
</html>
I'd like the child div (the red square) to be cropped by the bounds of the parent div (the black box).
Thanks
How can we have a parent div clip contents of children divs without scrollbars appearing:
<html>
<body>
<div id = "parent" style = "position:absolute; left:20px; top:20px; width:100px; height:100px; border:1px solid black;">
<div id = "child" style = "position:absolute; left:20px; top:20px; width:100px; height:100px; border:1px solid red;">
</div>
</div>
</body>
</html>
I'd like the child div (the red square) to be cropped by the bounds of the parent div (the black box).
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER