如何将HTML标记显示为文本

Mon*_*an5 5 html

如何在.html页面中显示HTML标记而不让浏览器尝试执行标记中的任何内容.

Cor*_*bin 13

您必须使用转义版本.例如<变为&lt;(没有引号)并&变为&amp;.

您应该能够找到完整的转换列表.

一个示例代码段:

&lt;a href="http://google.com"&gt;Google&lt;/a&gt;
Run Code Online (Sandbox Code Playgroud)

是转义版本:

<a href="http://google.com">Google</a>
Run Code Online (Sandbox Code Playgroud)

编辑:

标准的实体列表:http://www.w3.org/TR/html4/sgml/entities.html

维基百科上的艺术品:http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references