开发者

Should we give overflow:hidden to those div for which we are not giving height?

开发者 https://www.devze.com 2022-12-27 11:06 出处:网络
Should we give overflow:hidden to those div for which we are not giving height? #Container {width:900px;margin:0 auto}

Should we give overflow:hidden to those div for which we are not giving height?

#Container {width:900px;margin:0 auto}

for #header which has other elements inside then should i give overflow:hid开发者_如何转开发den to #header or i should give fixed height to #header.

What is the difference between both?

#header {}

#footer {}


No, it's not needed.

That rule is used as a work around to allow a container to take the full height of its child elements when they are floated. So unless you're floating elements inside it, the rule is extraneous, as there will be no overflow because the height is not specified.

See here for more info on why you would use overflow: hidden.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号