Home ] FAQ ] Web Pages ] Other Sites ]

 

Tag basics

Once you can create a simple page, it's time to start playing. Remember, everything that will appear on the page should go in the body section, between the <body> tag and the </body> tag.

Most tags turn an effect on or off. The <em> tag turns on the style "emphasized", which is usually italics. The </em> tag turns it back off. So, within the body section, we could have code that looks like this:

I <em>really</em> enjoy learning HTML.  

Some tags do not have a closing portion, like the <hr> tag, which makes a horizontal rule (line) on the page. It can stand by itself. Try adding this tag to your page.

You can use several tags at once...

This <strong>mostly bold sentence <em>has bold italics</em> in it.</strong>

But be sure to turn off all tags in a section before exiting the section! If we use the </strong> tag before the </em> tag, the browser may become confused, and the page will look much different than intended.

Tags do not care whether they are capitalized. <STRONG> is the same as <Strong> is the same as <strong> is the same as <sTrOnG>

Finally, many tags have "properties" that provide more detailed information, such as the color property of fonts.

It's not easy being <font color="green">this color</font>.

Note that the closing tag does not mention the property, only the main tag name.