Q:

How can I put html text on my webpage without the browser thinking it's part of the DOM?

I'm creating a website to help me learn web development. I want to be able to put html on my website, as if it were just text in a paragraph tag. I think that the browser thinks that the html is part of the DOM, because it never renders on the page the way I want. This is the simple code I have been using...
<pre>
    <code>
    "<!DOCTYPE html>
     <html>
     <!--All html goes here-->
     </html>
    "
    </code>
</pre>

Am I doing something wrong? How can I create a box of code on the page without the browser thinking it's part of the DOM? 
Thanks in advance!

A:

Use the proper entities:
<pre>
     &lt;!DOCTYPE html&gt;
     &lt;html&gt;
     &lt;!--All html goes here--&gt;
     &lt;/html&gt;
</pre>

