匿名内联框是否包含空格? [英] Does anonymous inline box contain whitespace?

查看:41
本文介绍了匿名内联框是否包含空格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了CSS2.1规范,并在匿名内嵌框"中了解了部分,它显示了一个匿名内联框的示例,如下所示:

I read about CSS2.1 Specification, and in "Anonymous inline boxes" section, it shows an example of anonymous inline boxes like this:

<p>Some <em>emphasized</em> text</p>

它说:

< p>生成一个块框,其中包含几个嵌入式框.强调"框是由内联元素(< em>)生成的内嵌框,而其他框("Some"和"text")是由块级元素(< p>)生成的内嵌框.).后者称为匿名内联框,因为它们没有关联的内联级元素.

the <p> generates a block box, with several inline boxes inside it. The box for "emphasized" is an inline box generated by an inline element (<em>), but the other boxes ("Some" and "text") are inline boxes generated by a block-level element (<p>). The latter are called anonymous inline boxes because they do not have an associated inline-level element.

然后我的问题是,为什么匿名内嵌框的内容是"Some"和"text"而不是"Some"和"text"之类的空格?

then my question is why anonymous inline boxes' contents are "Some" and "text" not something like "Some " and " text" include whitespace?

以下段落的含义是什么?

and what's the meaning of the following paragraph?

随后根据'white-space'属性折叠起来的空白内容不会生成任何匿名内联框.

White space content that would subsequently be collapsed away according to the 'white-space' property does not generate any anonymous inline boxes.

崩溃"是什么意思?

推荐答案

空格只是空间,没有样式,也无法定位,因此提及它是没有用的.他们仅提及它是为了提醒我们,如果您只有空格,例如5个空格,它们将全部折叠并仅显示一个空格.而且仍然无法成为目标,但值得一提.

The whitespace is just space, it is not styled and cannot be targeted therefore the mention of it is not useful. They only mention it to remind us that if you only had whitespace, such as 5 whitespaces they will all collapse and show only one. And it will still not be able to be targeted but worth the mention.

如果在该示例中没有诸如"some"和"text"之类的词,则仅会出现空白.但是由于空白不能设置样式并且不是块或内联元素,因此它只会折叠.换句话说,不必担心空格,因为它不是元素.

If there was no words such as "some" and "text" in that example then only white space would appear. But since whitespace cannot be styled and is not a block or inline element then it would just collapse. In other words, no need to worry about whitespace as it is not an element.

这篇关于匿名内联框是否包含空格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆