overflow property

 1)

















case1) When the width/height of child element is smaller than its' parent element:

























The green part is the parent and the blue part is the child.


Case 2) When the height of the child element is more than its' parent element:























Here the height of the parent is 100px ( green colour) but the height of the child is 200px( blue colour) which is > than its' parent.


Case 3) When both width and height of child is more than its' parent:

























We can clearly see that the content of child has overflown the boundaries of its' parent. So to avoid that we use overflow properties in CSS.



Comments