To node code, here's what I do:
[... my code goes here ...]

The <pre> tag ("preformatted text") puts it in a monospaced font and respects my whitespace, which is important for line breaks and indentation. The <blockquote> tag pushes the whole thing in from the margins a bit, and just looks a lot nicer.

You can see the effect on the HTML code above.

The Node Code

If you are going to put your code inline in a paragraph of text, you may want to use the <CODE> tag, which is often interpreted by browsers in much the same way as <PRE>. The <PRE> tag will put the enclosed text in its own paragraph, but <CODE> won't. The end result will be something like this.

See also best viewed with any browser.

Log in or register to write something here or to contact authors.