HTML tags

HTML tags are used to describe and control HTML document elements.


<a> - anchor or link to another page.

The <a> tag has 2 uses. It can be used in a page to act as a bookmark which is used to navigate to a particular position on a page.

The more common usage is as a link to another page and is used like:

<a href="thefilename.html">go to another page in my site</a> - to link to another page in your site. This is called a relative link as the description of the location of the file is relative to the current document.

This is a link <a href="http://www.w3.org/">W3C</a> - to link to an external page. This is called an absolute link as it describes the absolute location of the file you are linking to.

You can also use the <a> tag to link to an email address by using the following syntax:

<a href="mailto:myEmailAddress@someUrl.com">


<b>bolded text</b> - bold a portion of text


<br /> - line break

Note: the br tag is self closing denoted by the slash at the end of the tag.


<body></body> - the main body of an html document


<em></em> - emphasise a portion of text


<h1></h1> - a large heading


<h2></h2> - a smaller heading


<head></head> - the head of an html document


<hr /> - horizontal rule or line.

Note: the hr tag is self closing denoted by the slash at the end of the tag.


<html></html> - defines the whole of the html document


<i></i> - italicise text


<img /> - inserts an image into the document e.g.

<img src="images/iconCreate.jpg" width="32" height="32" />

Note: the img tag is self closing denoted by the slash at the end of the tag.


<li></li> - see <ul>


<p></p> - a paragraph


<table></table> - creates a table like a spreadsheet usually used to display tabular data.

The table tag must be used in conjunction with additional tags <tr> for table row and <td> for table definition e.g.

<table border = "1">
<tr>
<td>Cell A</td>
<td>Cell B</td>
</tr>
</table>

would display as:

Cell A Cell B

<title></title> - the title of the document, always nested within the head tags.


<ul></ul> - used to create an unordered list of items in conjunction with the list item <li> tag.

<ul>
<li>item 1
<li>item 2
<li>item 3
</ul>


A full list of tags can be found on the W3C's site. Note: as discussed in class pay attention to those which have been depreciated.