【发布时间】:2010-12-12 03:59:29
【问题描述】:
这是你读过一次的东西之一,说“啊哈!”然后忘记。正是我的情况。
为什么 xhtml 中的换行标记优先使用空格 <br /> 而不是也可以的格式 <br/> ?我记得原因很有趣,你可以想象用谷歌很难找到。
确定这不是 xml 格式正确的问题。来自 W3C
[44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'
Empty-element tags may be used for any element which has no content, whether
or not it is declared using the keyword EMPTY. For interoperability, the
empty-element tag should be used, and should only be used, for elements which
are declared EMPTY.
Examples of empty elements:
<IMG align="left" src="http://www.w3.org/Icons/WWW/w3c_home" />
<br></br>
<br/>
所以最后的空格是可选的。
【问题讨论】:
-
看起来不错。我猜...
-
不不,还有别的原因。
-
另外
是 XML 而 不是 HTML。 HTML 只是
-
你的意思是 XHTML,不是 XML。
-
他的意思是 XML:看看 XHTML 中的 X 代表什么。