Skip to content
New issue

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

什么是BFC?如何形成BFC?BFC有什么使用场景 #42

Open
ray-sh opened this issue Dec 9, 2019 · 0 comments
Open

什么是BFC?如何形成BFC?BFC有什么使用场景 #42

ray-sh opened this issue Dec 9, 2019 · 0 comments

Comments

@ray-sh
Copy link
Owner

ray-sh commented Dec 9, 2019

BlockFormattingContext,块级元素参与构建的、遵循一定规则的独立环境;参与的子项可能会创建新的块级格式化上下文,与外层上下文有同样的规则;3.新上下文中的子项与外层上下文的子项隔绝。

形成条件:1. 根元素;2. float属性不为none;3. position为absolute、fixed、sticky; 4. display为inline-block、table-cell; 5. display:flow-root; 6. overflow为hidden、scroll、auto。

使用场景: 1. 阻止父子外边距合并; 2. 阻止块级元素与浮动元素的覆盖; 3. 清除浮动,撑开浮动元素父容器。

来自饥人谷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant