HTML Tags


Introduction Tag syntax Page structure Validation Useful tags Style sheets Tables Useful links

HTML markup uses tags to identify the various elements of a document. An opening tag marks the start of an element (e.g. a title) and a closing tag marks the end.

Tags are surrounded by the less than (<) and greater than (>) symbols. For example <title> is the start tag which identifies a page title. The corresponding end tag is </title> - the same as the start tag but preceded by a / character.
<title>This is an example of a title in an HTML document</title>

In the latest HTML standards, the tag element name and the name of any attributes (which we will come to later) must be lower case.
<title>This is correct</title>
<TITLE>but this isn't.</TITLE>

Additionally, all tags must be closed. If you have an opening tag, you must have a corresponding closing tag. If you have used HTML before, you may be aware that certain tags, e.g. <br> (a line break), did not need to have a closing tag. This is one of ways HTML is being cleaned up - by removing exceptions to rules. However, to save you a bit of typing, empty elements (i.e. where nothing occurs between the start and the end tag) can be condensed into a single tag with a trailing / symbol.

For example
<br></br> can be condensed to
<br /> (note the space before the / which is required for compatibility with older browsers)


Valid XHTML 1.0! Valid CSS!

Note that this course was written in 2003, and things have moved on since then! You might like to check out this site for a more up to date html overview.


© Dial Solutions 2003
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; A copy of the license can be found at www.gnu.org/copyleft/fdl.html