Saturday, January 27, 2007

Display HTML tags in HTML pages

If you want to display an HTML tag in a web page (including posts in this blogger), you have to replace the tag markers "<" and ">" by their equivalent ASCII entities "&lt;" (which stands fot "less than") and "&gt;" (which stands for "greater than") respectively.

Check the W3 Schools to learn about other HTML entities.

Just another note: if you want to indent your tags on the page, a simple way to do this is to use the char "&nbsp;" (which stands for "non blocking space"). This char is not compressed by the browser when rendering a page.

No comments: