Is there a way to write HTML onto a webpage, but have it rendered as text?
Let me explain: I want to build a webpage with a discussion on HTML. Therefore there will be sections like
<div>
<p>
<span>Hello world</span>
</p>
</div>
I would like that to formatted properly with indentation, and perhaps even have the tags in a different colour scheme.
I’m fully aware that I could write the styling for this myself, but surely someone has already written and made available a stylesheet, a LESS mixin, or perhaps a jQuery plugin which recognises and formats for me?
UPDATE: Just to make people aware, I realise that I have to HTML-encode the tags (< and >). But that doesn’t help with the formatting/presentation, and it’s the formatting/presentation that I’m looking for help with.
You are looking for SyntaxHighlighter. See demo page here