HTML documents require four special container tags: HTML, HEAD, TITLE, and BODY. They also require one empty tag: DOCTYPE. These five tags tell the browser that the contents of the file are in HTML and not plain text. If the file does not contain these tags, the browser will read the file as a plain text file and will not display it properly as a Web page.
You will learn more about these required HTML tags in the Slide Show below.
The DOCTYPE empty tag is used to indicate the version of HTML used. It is good practice for HTML.
The HTML container tag tells the browser where the HTML code begins and ends.
The HEAD container tag contains information about the document, such as its creation date and author.
The TITLE container tag lists the title of the document to appear in the browser title bar.
The BODY container tag encloses the text, graphics, hot links, and other content to be displayed by the browser
The HTML standard contains specifications for formatting text, displaying graphics, and embedding a variety of multimedia files, such as sound files. There are also specifications for creating and formatting tables.
The table below lists the tags used most frequently to perform these functions. You can also download this table as a PDF via the Resources page.
Attributes are added within a tag to modify or extend its functionality. For example, the <BODY> tag can be used with the attribute BGCOLOR to specify the background color for your page , as follows:
It is best to enclose all attributes in quotation marks. However, quotes are mandatory only in attributes that require any character other than a letter or a number. So technically, the word WHITE in the example does not require quotation marks. The attribute #FFFFFF, which is also used to specify color, would require quotation marks because # is neither a letter nor a number.
Some attributes require a value; others can stand alone. Multiple attributes may be added within a tag.
While the order of the attributes is not important, they must be positioned after the tag name.
In the next lesson, you will learn about the purpose of META tags and how to use them.