Monday, June 6, 2011

Easy Way to Keep HTML in Blog from Executing

Here's how to keep code from executing in your blog post when you are trying to show what the code looks like (rather than have it execute):

Instead of the left pointing caret, put this: & l t ; (put all 4 characters with no spaces) to produce: <
Instead of the right pointing caret, put this: & g t ; (put all 4 characters with no spaces) to product: >
EXAMPLE:

To produce this:

<form action="/search" method="get">
<input name="q" type="text"/>
<input value="Search" type="submit"/>
</form>

I typed this (although this is a picture here):

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...