We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
今天突然想到BFC,就想到了 overflow:hidden 可以触发BFC。就有点疑惑为啥该操作可以清楚浮动,它的本意不是用来超出隐藏的吗?
网上搜了一番在知乎上看到 貘吃馍香 的回答,颇获收益,答案如下:
overflow:hidden 的意思是超出的部分要裁切隐藏掉 那么如果 float 的元素不占普通流位置 普通流的包含块要根据内容高度裁切隐藏 如果高度是默认值auto 那么不计算其内浮动元素高度就裁切,就有可能会裁掉float 这是反布局常识的
所以如果没有明确设定容器高情况下 它要计算内容全部高度才能确定在什么位置hidden 浮动的高度就要被计算进去 顺带达成了清理浮动的目标 同理 overflow 非默认值 position 非默认值 float 非默认值等 都是遵循这个布局计算思路
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: