Displaying code inside a post



In my posts I have put some code-snippets. I got some questions on how I did this. Well, to be honest, it is very easy.
I am using the

-tag inside my post. Anything that is put between a 
 and a 
-tag is handled by your browser as pre-formatted, and your browser leaves it as it is. You can add some styling to it inline, such as
, or you can add a class definition to your template skin.
If you want to display html-code inside your post, be aware that you have to replace every < by <, and every > by >.




0 comments: