内联框与原子内联框之间的区别 [英] Difference between inline box and atomic inline box
问题描述
请考虑以下代码:
< div>< / div>
div {
display:inline-block;
}
div块是现在生成的原子内联框。正如规范中所述。 9.2.2
不是内联框的内联框(例如替换
内联级元素,内联块元素和内联表
元素)被称为原子内联级框,因为它们
作为单个不透明框参与其内联格式化上下文。
在这种情况下,'不透明'是什么意思?内联框是否作为透明框参与了内联格式化上下文?
所以我对原子内联框和内联框之间的区别感兴趣吗?
从WC3 CSS2.1规范,章节 b
$ b
一个内联框是一个内联框,其内容
。
参与其包含的内联格式化上下文。 'display'值为'inline'的
非替换元素将生成
内联框
不是内联框的内联框(如
替换了内嵌级元素,内嵌块元素和
内联表元素)被称为原子内联级因为
他们作为一个不透明的
盒子参与他们的内联格式化上下文。
因此 $ b 至于你对 不透明表示该框是单数,如果它的文本 -level方块包含... 最后,如图所示,行内框是行内框的超集。 希望可以帮助别人。 Consider the following code: div block is generated atomic inline-level box now. As said in spec. 9.2.2 Inline-level boxes that are not inline boxes (such as replaced
inline-level elements, inline-block elements, and inline-table
elements) are called atomic inline-level boxes because they
participate in their inline formatting context as a single opaque box. What does 'opaque' mean in this case? Is inline boxes participated in the inline formatting context as a transparent box? So I'm interested in what difference between atomic inline-level box and inline box? From the WC3 CSS2.1 Specification, Chapter 9 Visual formatting model: An inline box is one that is both inline-level and whose contents
participate in its containing inline formatting context. A
non-replaced element with a 'display' value of 'inline' generates an
inline box. Inline-level boxes that are not inline boxes (such as
replaced inline-level elements, inline-block elements, and
inline-table elements) are called atomic inline-level boxes because
they participate in their inline formatting context as a single opaque
box. Therefore With regards to your question on what CSS Spec - Atomic Inline Level Boxes Opaque means that the box is a singular, solid unit, and that it
cannot be split across lines like an inline box can when its text
cannot all fit on a single line.
Inline-level boxes includes boxes... And finally, as seen, inline-level boxes is a super-set of inline boxes. Hope that helps someone in the future. 这篇关于内联框与原子内联框之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
display:inline
生成行内框。
的元素display:inline-table | inline-block
和替换的内联级元素(如< img>
)生成行内级原子框。
opaque
意味着什么的问题,@BoltClock解释它在这里一个很好的方式:
不能全部适合在一行中,那么
不能像行内框一样拆分。
这里有一些额外的细节,可能有助于
的元素生成:display:inline
空白$ c>),则单个子行内元素将分离并落入新行$ c>属性没有改变)。实际上,父级内嵌框会分成几个框。这里,父级内嵌框中的所有内联级元素存在于一个大快乐行内格式化上下文中。
$ b
/ li>
display:inline-table的元素生成|内联块| inline-flex |内联网格
<div></div>
div{
display: inline-block;
}
display: inline
generates inline boxes.display: inline-table | inline-block
and replaced inline-level elements (like <img>
) generates inline-level atomic boxes.opaque
means, @BoltClock explains it in a great way here:
And here is some additional detail from me, that might help
display: inline
white-space
property is not changed). In effect, the parent inline box will split into several boxes. Here, all the inline-level elements inside the parent inline box, live in one big happy inline formatting context.
display: inline-table | inline-block | inline-flex | inline-grid