2.0 Tags

Learning HTML is essentially about learning the many different tags that are available for writing web pages. A definitive list of HTML tags can be found in the Useful Tools section but first we will look at using some of the more commonly used tags. These are shown below along with brief descriptions of their useage.

TagPurpose
<h1>Is used for displaying headings
<h2>For sub-headings
<h3>For sub-sub-headings...goes down to <h6>
<p>For paragraphs of text
<b>For bold text
<i>For italic text
<small>For small text
<br />Forces a line break
<hr />Draws a horizontal line (rule)

Similar to the way in which a picture can speak a thousand words, a few examples can often help clear the confusing mists too. Below is an example of a simple web page using all of the tags discussed so far. And remember, always close the tags in the same order in which they were opened.

<html>
  <head>
  </head>
  <body>
    <h1>My first Website</h1>
    <br />
    <p>Hello <b>beautiful</b> world!!</p>
    <hr />
    <p>You <i>can</i> do it if you learn the tags &amp; don't give up!</p>
  </body>
</html>

This simple mark-up would look like this in a browser:

My first Website


Hello beautiful world!!


You can do it if you learn the tags & don't give up!

This is a very basic layout, admittedly, but it can be vastly improved by the use of attributes to add some styling in the form of colour, to change the text fonts etc. This will be explained in the section on attributes.