-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
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)
Metadata
Metadata
Assignees
Labels
No labels