为什么“overflow:hidden”清除浮动? [英] Why "overflow: hidden" clears a float?

查看:96
本文介绍了为什么“overflow:hidden”清除浮动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题很简单:为什么 overflow:hidden; 清除浮动?

The question is simple and short: why does overflow: hidden; clear floating? I looked in to the w3 standard documentation and it did not imply anything.

推荐答案

因为你在使用时创建了一个新的块格式化上下文 overflow 与任何其他的可见 to w3.org specs )。

Because you establish a new Block Formatting Context when using overflow with anything ofther then visible (link to the w3.org specs).

这篇关于为什么“overflow:hidden”清除浮动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆