How to display html code on website.

Concept to display HTML code on the website.

The HTML code is started from a tag that is '<' (less than )  and closed with  '>'  greater than.

Let's come to the point, you need to convert.

'<'  to &lt;     (we write less than tag (<) as &lt; )
'>' to &gt;  (we write greater than tag (>) as &gt; )


View HTML code onWeb Page

  1. <pre>
  2. &lt;div class="html"&gt;
  3. &lt;html&gt;
  4. &lt;head&gt;&lt;title&gt;Title&lt;/title&gt;&lt;/head&gt;
  5. &lt;body&gt;
  6. &lt;p&gt;Unrendred html&lt;/p&gt;
  7. &lt;/body&gt;
  8. &lt;/html&gt;
  9. &lt;/div&gt;
  10. </pre>

  • simply copy above snippet and paste in html page

Comments

Popular posts from this blog

Which type of feed is useful for feedburner either rss or atom

How to use set interval in Typescript

nvm command is not recognized in ubuntu