Here is the CSS
code I have written;
#container {
width: 1300px;
background-color:green;
margin:0 auto;
overflow:hidden;
}
#menu {
float:left;
width:20%;
background-color: yellow;
}
Even after extensive searching on Google, I have been unable to find an explanation as to why the background color of the container disappears when the container's overflow
attribute is set to visible.
Could someone provide some insight into why this happens?
Update:
Thank you for all the feedback and responses! :)
Although I am fine with using overflow:hidden
, I am interested in understanding its purpose and how to utilize it effectively.
From what I gather, the overflow property determines what happens when content exceeds an element's boundaries, so I am perplexed as to why setting it to visible would cause the container's background color to vanish or alter the container's height.