Required Elements


To see what HTML looks like and learn the most basic HTML tags, let's look at a very simple HTML document. Figure 2.1 shows a simple Web page in Microsoft Notepad. You can type the same text in your own editor to follow along with the lesson.

Figure 2.1. The <html> and </html> tags are all you need to identify your file as an HTML file.


Every HTML document must begin with the <html> tag and end with its complement, the </html> tag. In addition to the <html> tag, this document includes three other pairs of tags that should be included in any HTML document:

  • The <head> and </head> tag pair is used to indicate any information about the document itself. You'll learn how to add some of this information in later lessons.

  • The <title> and </title> tags are used to add a title to your browser's Title bar. The Title bar is the colored band at the top of any application that gives the name of the application.

  • The <body> and </body> tags are used to surround any text that appears in the HTML page.

All HTML documents are separated into two parts: the head and the body. Because the title contains information about the document, the <title> and </title> tags are placed within the <head> and </head> tags.

One More Page

If you were to create another simple HTML page, you would see that the same four tags are present in this document as well. Only the text that appears between tags is changed.

<html> <head> <title>My Second Web Page</title> </head> <body> <p>This is my second Web page.</p> </body> </html>


Tip

Most HTML tags come in pairs. You use the first tag in the pair (for example, <html>) to tell the computer to start applying the format. The second tag (for example, </html>) requires a slash in front of the tag name that tells the computer to stop applying the format. The first tag is usually referred to by the name within the bracket (for example, HTML). You can refer to the second tag as the end, or the close, tag (for example, end HTML).




Sams Teach Yourself HTML in 10 Minutes
Sams Teach Yourself HTML in 10 Minutes (4th Edition)
ISBN: 067232878X
EAN: 2147483647
Year: 2004
Pages: 151
Authors: Deidre Hayes

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net