To show HTML code in HTML page, you can use the <code> tag or the <pre> tag.

Example using <code> tag:

<code>
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;My HTML Page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;p&gt;This is an example of HTML code.&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
</code>

Example using <pre> tag:

<pre>
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;My HTML Page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;p&gt;This is an example of HTML code.&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
</pre>

Both tags will display the HTML code as plain text with the correct syntax highlighting.

how to show html code in html page

原文地址: https://www.cveoy.top/t/topic/bcWL 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录