An Introduction to HTML

[ Understanding HTML Tags | The First Four Tags: html, head, title, body ]

Go directly to the next page, Editing Your HTML File.

Understanding HTML Tags

HTML stands for HyperText Markup Language, and is used to create web page documents. HTML uses "tags," which are HTML syntax/commands interpreted by the web browser which modify and customize a text document into a web page. Tags look like this:

<tag> affected (tagged) text </tag>
Anything found between the tags is affected by the the tag: the forward slash (/) in the second tag closes or ends the effects of the opening tag. For example,
<center> This text would show up centered! </center>
Almost every tag has both an opening and closing tag, with only a few exceptions (<br>,<p>, and <img src=filename.extension>) which will be discussed later. Every html document must be saved with the extension (ending) ".html" to ensure that the document can be properly recognized. The first tag used in an HTML document, <html>, must also be included for the browser to interpret the document correctly.
Tags also have additional attributes (the attributes vary depending on the tag) which act like sub-tags on the original tags. "Font," for example, has attributes for "size" and "color":

<font size="4"color="blue"> This will make the size of the text slightly larger, and change the color to blue. Notice how we only end the "font" part, rather than including the attributes. </font>
The First Four Tags

The four tags generally used to create a web page are html, head, title, and body. As stated above, the first and last tags in an HTML document must be <html> and </html>, so the document is recognized as an HTML file.
The second tag is the <head> tag, which provides information to the browser, and normally contains the title of the page as well, which is displayed in the upper left-hand corner of Netscape when the page is accessed:

<head> 
<title> This is the title, displayed in the browser heading itself.
The title should be between the opening and closing "head" tags.
</title> 
</head> 
The <body> tag is the last of the first four tags, and can be used to change the background color, background image, text or link colors with various includable attributes (as mentioned above). The <body> tag should follow the </head> tag, while the closing body tag, </body>, should come directly before the closing html tag, </html>. A very basic page, therefore, will look something like this, with the appropriate text substituted:

<html>
<head> 
  <title>Insert Title Here </title>
</head>
<body body_attributes=value>
Insert the Body of the Text Here
</body>
</html>

Now that we've gotten this far, let's continue on and go to Editing Your HTML File.