• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1410
  • Last Modified:

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
0
minnirok
Asked:
minnirok
1 Solution
 
RoonaanCommented:
<div style="overflow:hidden">

-r-
0
 
minnirokAuthor Commented:
thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now