Skip to main content

Structure of an HTML Document

An HTML document has two main parts: the head and the body. But firstly every HTML document should start by declaring that it is an HTML document.

These tags are of the form:

<html>
Should appear at the beginning of your document.
</html>
Should appear at the end of your document.

HTML Tags

This leads us nicely on to say more about [X]HTML tags. All formatting tags (or elements) are of the general form:

<tag_on>
Switches the tag sequence on. For example, to bold some text add a <strong> at the beginning of the text.
</tag_off>
Switches the tag sequence off. The tag_on and tag_off tags are the same except the off tag has an / character in front of it. For example, to switch off the bolding add a </strong> character sequence at the end of the text that is to be given the attribute of bolding.

Note: HTML is a case insensitive mark-up language, i.e. as far as all browsers are concerned the tags <HTML> and <html> are indistinguishable. However XHTML uses only lowercase tags which will be used throughout this course.