- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有没有关于如何正确处理 XHTML (1.0 Transitional) 中的空格的信息?似乎 XHTML 不使用标准的 XML 空白处理。
编辑:梅比我对我到底在寻找什么有点不准确。我对元素如何呈现比 XML 处理器如何处理更感兴趣。
例如,以下将呈现中间有 1 个空白:
<em> em content </em> following text
<a href="http://www.google.de"> content of the hyperlink </a> content after the hyperlink
在超链接的末尾会有一个带下划线的空格,而
<a href="http://www.google.de"> content of the hyperlink</a> content after the hyperlink<br />
不会在空格下划线。
最佳答案
来自 W3C Recommendation :
4.7. White Space handling in attribute values
When user agents process attributes, they do so according to Section 3.3.3 of [XML]:
- Strip leading and trailing white space.
- Map sequences of one or more white space characters (including line breaks) to a single inter-word space.
3.2. User Agent Conformance
[1-8 snipped]
9.
White space is handled according to the following rules. The following characters are defined in [XML] white space characters:
- SPACE
( )
- HORIZONTAL TABULATION
(	)
- CARRIAGE RETURN
(
)
- LINE FEED
(
)
The XML processor normalizes different systems' line end codes into one single LINE FEED character, that is passed up to the application.
The user agent must use the definition from CSS for processing whitespace characters [CSS2]. Note that the CSS2 recommendation does not explicitly address the issue of whitespace handling in non-Latin character sets. This will be addressed in a future version of CSS, at which time this reference will be updated.
C.15. White Space Characters in HTML vs. XML
Some characters that are legal in HTML documents, are illegal in XML document. For example, in HTML, the Formfeed character (U+000C) is treated as white space, in XHTML, due to XML's definition of characters, it is illegal.
关于xhtml - XHTML 中的空白处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2836424/
我是一名优秀的程序员,十分优秀!