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
一个元素的盒模型的定位、尺寸常常会依据某个矩形(box)来计算,这个矩形就叫做这个元素的 包含块 (containing block)
如果某些属性被赋予一个百分值的话,它的计算值是由这个元素的包含块计算而来的。这些属性包括盒模型属性和偏移属性:
特殊情况: 如果 position 属性是 absolute 或 fixed,包含块也可能是由transform or perspective 不是 none(will-change, filter 也可能)最近父级元素的内边距区的边缘组成的(dialog中设置transform: translate(-50%,-50%) 居中的时候, 可能会遇到)
position为relative或static或sticky的元素 其包含块是由其包含块元素的 Content Edge 创建 position为absolute的元素 其包含块是由其包含块元素的 Padding Edge 创建
The text was updated successfully, but these errors were encountered:
No branches or pull requests
包含块的定义
一个元素的盒模型的定位、尺寸常常会依据某个矩形(box)来计算,这个矩形就叫做这个元素的 包含块 (containing block)
包含块的作用
如果某些属性被赋予一个百分值的话,它的计算值是由这个元素的包含块计算而来的。这些属性包括盒模型属性和偏移属性:
包含块的确定
特殊情况: 如果 position 属性是 absolute 或 fixed,包含块也可能是由transform or perspective 不是 none(will-change, filter 也可能)最近父级元素的内边距区的边缘组成的(dialog中设置transform: translate(-50%,-50%) 居中的时候, 可能会遇到)
容易混淆
position为relative或static或sticky的元素 其包含块是由其包含块元素的 Content Edge 创建
position为absolute的元素 其包含块是由其包含块元素的 Padding Edge 创建
The text was updated successfully, but these errors were encountered: