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
clear: both;
浮动末尾添加新标签或使用 ::after 为元素,设置样式为 clear:both。
::after
clear:both
原理:清除浮动的块盒在 margin-top 上所产生的间距(clearance)的值与其 margin-top 之和应该足够使其 border-top 恰好与浮动元素的 margin-bottom 相邻接。
margin-top
border-top
margin-bottom
BFC
构造 BFC 的方法
float
none
overflow
visible
display
table-cell, table-caption, inline-block
position
absolute
fixed
IE6/7
has layout
has layout的方法
position: absolute
inline-block
height
auto
width
zoom
normal
The text was updated successfully, but these errors were encountered:
No branches or pull requests
clear: both;
浮动末尾添加新标签或使用
::after
为元素,设置样式为clear:both
。原理:清除浮动的块盒在
margin-top
上所产生的间距(clearance)的值与其margin-top
之和应该足够使其border-top
恰好与浮动元素的margin-bottom
相邻接。构造
BFC
构造
BFC
的方法float
设置为非none
值overflow
设置为非visible
display
设置为table-cell, table-caption, inline-block
position
设置为absolute
或fixed
IE6/7
下没有BFC
的概念,但有类似BFC
的has layout
has layout
的方法has layout
has layout
的元素position: absolute
float
不为none
display
:inline-block
height
:除auto
外任意值width
:除auto
外任意值zoom
:除normal
外任意值overflow
非visible
(仅限 IE7)The text was updated successfully, but these errors were encountered: