Basic HTML Tags

The most basic HTML tags are those which let the browser know important things about the document itself rather than how to display the body of the document. The following table outlines the HTML tags that define the basic HTML document.

Opening Tag Closing Tag Description
<!DOCTYPE> none
Defines the HTML specification your document uses such as <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">. This tag will be used before the <HTML> tag.
<HTML> </HTML>
Specifies that the document should be interpreted as an HTML document. This tag should either be the first line in an HTML document or should be directly after the <!DOCTYPE> specification. Likewise, the closing tag should be the last line in an HTML file.
<HEAD> </HEAD>
Specifies an area where the browser can look to for general information about the document. It requires a <TITLE> tag at the minimum.
<TITLE> </TITLE>
Specifies the text that will be used for the header of the browser frame. Some search engines use this text for keyword indexing and browsers will use this for naming bookmarks if a user chooses to bookmark your site. So choose your titles well. This tag goes between the <HEAD> and </HEAD> tags.
<BASE> None
Specifies the base URL that all relative links should utilize. This helps if you move an entire site off its original server and need to quickly make all relative links work at their new locale. This tag must appear within the bounds of the <HEAD> element. You will use this tag only with corresponding HREF attribute such as <BASE HREF = "www.mydomain.com">
<BODY> </BODY>
Specifies the information that should be displayed in the browser window. This is the document itself rather than information "about" the document.
<!-- comment goes here--> none
You can create comment text that will not be displayed by the browser by placing it between the <!-- and the -->. Some browsers also support the <COMMENT></COMMENT> tags.
<META> none
Embeds information about the document. You can use the tag with the following attributes provided you use it within the bounds of the <HEAD> element:

<META HTTP-EQUIV = "REFRESH" CONTENT = "10; url=doc2.html"> - Automatic redirection

<META NAME = "Description" CONTENT = "a description of page"> - Gives a search engine a description to use

<META NAME = "Keywords" CONTENT = "comma separated keywords"> - Gives a search engine help for indexing

<META HTTP-EQUIV = "PRAGMA" CONTENT = "no-cache"> - Tells the browser not to cache the page.

Basic HTML Tags by Example
Consider the following example that creates the minimum web page....

<!DOCTYPE HTML PUBLIC "-/IEFT//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Hello World</TITLE>
<META HTTP-EQUIV = "Description" NAME = "Description"
CONTENT = "This page is simply a basic HTML page">
<META HTTP-EQUIV = "Keywords" NAME = "Keywords"
CONTENT = "HTML, learning, example">
</HEAD>
<BODY> <!--This is a comment and comments do not show up in the browser --> This is a very simple web page </BODY>
</HTML>