Link to home
Start Free TrialLog in
Avatar of condor888
condor888

asked on

How do you understand "overflow:hidden" in the CSS of the codepen snippet?

This is a codepen snippet.

With "overflow:hidden" being set for the div with class "father", I can actually see the father CSS "box" with background color pink. However, if that is not set, I cannot see the father CSS "box".

So what does "overflow:hidden" used for in this scenario?
Avatar of zc2
zc2
Flag of United States of America image

you don't see the pink without the overflow because the height of the father is zero.
if you add this style to the father "border: 2px solid red;" you will see that.
Avatar of condor888
condor888

ASKER

Hi zc2, thanks for your quick comments. That's a good way to debug. So the question comes to be why with "overflow:hidden", the outside box can be pushed bigger? Thanks!
SOLUTION
Avatar of Alexandre Simões
Alexandre Simões
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial