gpt4 book ai didi

css - 为什么溢出:hidden creates BFC(Block Formatting Context)?

转载 作者:行者123 更新时间:2023-11-28 15:54:43 24 4
gpt4 key购买 nike

我了解到 overflow:hidden 只处理溢出包含它的框的上下文。

但是为什么 overflow:hidden 会创建 block 格式化上下文?

这两者有什么关系? (处理溢出的上下文与创建新的 block 格式化上下文。)

我已经尝试阅读其他文章,但我不明白“为什么”

我只需要记住吗?

迫切需要一些帮助..

最佳答案

Using the overflow property with a value different to visible (its default) will create a new block formatting context. This is technically necessary — if a float intersected with the scrolling element it would forcibly rewrap the content. The rewrap would happen after each scroll step, leading to a slow scrolling experience.

关于css - 为什么溢出:hidden creates BFC(Block Formatting Context)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41332897/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com