You are currently browsing the page Display codes in the HTML category.

Display codes

Here are various ways to display HTML codes...

Using code: (Take care, you will have to replace all < by &lt; and all > by &gt;!) This is what I actually use. I customized it with CSS:

<code>Your codes come here</code> Using pre:

<pre>It keeps the white space and lines break but you still have to replace < and > by &lt; and &gt;</pre>

It keeps the white          space and
lines break but you still have
to replace < and > by &lt; and &gt;

Using xmp: (This shows the exact text you put, you don't have to replace anything but it's deprecated)

<xmp><a href="code">example</a></xmp> Of course, all those tags can be customized via CSS so they will look better.

Print This Post Print This Post



Sponsors


Leave a Comment

Works? Doesn't work? Other tips? Please leave a comment! :)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

To post codes, please go to SimpleCode and transform your codes first, so that it will displayed properly. Indeed, < and > need to be converted to &lt; and &gt; :)


Close
E-mail It