Sunday, November 1, 2009

Inserting HTML tags

The problem with writing HTML, ASP etc. codes in your page is that the browser considers anything starting with an angle bracket as HTML code, it will try to make something of the code and hence your page will not be the way you intended it to be.

Let's say you are writing a tutorial for HTML and you want to convey to your readers how to make certain words appear bold in html. You'll naturally use the tag for bold... you'll try to use the tag, write some text within the opening and closing tags and try to show your users how the tag is used... instead, what you'll get will be the text appearing as bold and the tags used to make words appear bold absent.. this is because the browser considered the bold tag to be what it actually is.. the bold tag, it would think that you intended the text to appear in bold.. how is it supposed to know you are writing a tutorial anyways... (on second thought, if you are good enough to be writing HTML tutorials.. you would know this already)

What makes a tag, a tag are the surrounding angle brackets.. if you omit them anything you write won't be considered HTML or ASP tags.. the trick is to use the codes for the angle brackets...
The codes are as follows









<&lt;
>&gt;


So for the above example, you'll write something like..

<b>This is bold text.</b>

Refer to the following link for more codes..
http://codex.wordpress.org/Writing_Code_in_Your_Posts