How to display raw HTML code on an HTML page?

Spread the love

Sometimes, we want to display raw HTML code on an HTML page.

In this article, we’ll look at how to display raw HTML code on an HTML page.

How to display raw HTML code on an HTML page?

To display raw HTML code on an HTML page, we use a pre element.

For instance, we write

<pre>
  <code>
    My pre-formatted code
    here.
  </code>
</pre>

to put the raw content in a pre tag to render them as is.

Conclusion

To display raw HTML code on an HTML page, we use a pre element.

Leave a Reply

Your email address will not be published. Required fields are marked *