【发布时间】:2020-07-27 09:43:37
【问题描述】:
我希望窗口中的输出显示实际的"<!-- -->"。我如何引用它以便打印出来?
打印出 <h2>Text Here</h2> 也是如此 - 我希望它实际打印出来,而不是使用 <h2> 样式。
【问题讨论】:
我希望窗口中的输出显示实际的"<!-- -->"。我如何引用它以便打印出来?
打印出 <h2>Text Here</h2> 也是如此 - 我希望它实际打印出来,而不是使用 <h2> 样式。
【问题讨论】:
&lt; 是
&gt; 是 >
看看这段代码sn-p:
This will appear as a comment:
<br><!-- Test -->
<br>
<br>This will actually appear:
<br><!-- Test -->
您可以在此处了解如何转义字符:https://ascii.cl/htmlcodes.htm
xmp标签警告: MDN 网络文档不鼓励使用此功能:
此功能已过时。尽管它可能在某些浏览器中仍然有效,但不鼓励使用它,因为它可能随时被删除。尽量避免使用它。
来源:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/xmp
This will appear as a comment:
<br><!-- Test -->
<br>
<br>This will actually appear:
<br><xmp><!-- Test --></xmp>
【讨论】: