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
页面渲染时,DOM元素所采用的布局模型,通过box-sizing设置
DOM
box-sizing
content-box
width = content
border-box
width = content + padding + border
块级格式化上下文,是一个独立的渲染区域,处于BFC内部的元素与外部元素相互隔离,使内外元素的定位不会相互影响
BFC
html
position
absolute/ fixed
float
none
overflow
visible
display
inline-block/ table/ flex
Box
margin
!important > 内联样式 > id选择器 > 类/属性/伪类 > 元素/伪元素 > 其他 相同权重,后写的生效 选择器从右往左解析
!important
id
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1. 盒模型
页面渲染时,
DOM
元素所采用的布局模型,通过box-sizing
设置content-box
(W3C 标准盒模型):width = content
border-box
(IE 盒模型):width = content + padding + border
2. BFC
块级格式化上下文,是一个独立的渲染区域,处于
BFC
内部的元素与外部元素相互隔离,使内外元素的定位不会相互影响创建方式
html
根元素position
为absolute/ fixed
float
不为none
overflow
不为visible
display
为inline-block/ table/ flex
BFC 特性
BFC
的两个相邻Box
垂直排列BFC
的两个相邻Box
的margin
重叠BFC
的区域,不会与float
元素的区域重叠BFC
高度时,浮动元素也会参与计算BFC 应用
margin
重叠层叠上下文
选择器优先级
!important
> 内联样式 >id
选择器 > 类/属性/伪类 > 元素/伪元素 > 其他相同权重,后写的生效
选择器从右往左解析
The text was updated successfully, but these errors were encountered: