You will at least want to use the <PRE> tag in your HTML where you demonstrate the code example. This will format your code in a monospace font by default and preserve spaces and line breaks so your code looks as you've formatted it.
Another option is to use a JavaScript solution to help format your code such as SyntaxHighlighter. This useful script can be added easily to a blog site like Blogger or WordPress. Good documentation is available on the site at alexgorbatchev.com
Another option is to use a JavaScript solution to help format your code such as SyntaxHighlighter. This useful script can be added easily to a blog site like Blogger or WordPress. Good documentation is available on the site at alexgorbatchev.com