开发者

Why we Show encoded ampersand on HTML pages

Why we use & instead of &开发者_C百科 ?

What is the advantage ?


From HTML 4.0.1 Specification:

Authors should use & (ASCII decimal 38) instead of & to avoid confusion with the beginning of a character reference (entity reference open delimiter). Authors should also use & in attribute values since character references are allowed within CDATA attribute values.

Your question should be reversed!


You should always use &, because that's the only way to create valid HTML.

Since the & character is used for entities (such as & or >), it must be escaped in order to write a literal &.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜