Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Tags Every HTML Page Must Have

The time has come for the secret language of HTML tags to be revealed to you. When you understand this language, you will have creative powers far beyond those of other humans. Don't tell the other humans, but it's really pretty easy.

Most HTML tags have two parts: an opening tag, which indicates where a piece of text begins, and a closing tag, which indicates where the piece of text ends. Closing tags start with a / (forward slash) just after the < symbol.

For example, the <body> tag in Figure 2.1 tells the Web browser where the actual body text of the page begins, and </body> indicates where it ends. Everything between the <body> and </body> tags will appear in the main display area of the Web browser window, as you can see in Figure 2.2.

Netscape Navigator displays any text between <title> and </title> at the very top of the Netscape window, as you can also see in Figure 2.2. (Some very old Web browsers display the title in its own special little box instead.) The title text is also used to identify the page on the Netscape Navigator Bookmarks menu or in the Microsoft Internet Explorer Favorites list.

You will use the <body> and <title> tags in every HTML page you create because every Web page needs a title and some body text. You will also use the other two tags shown in Figure 2.1, <html> and <head>. Putting <html> at the very beginning of a document simply indicates that this is a Web page. The </html> at the end indicates that the Web page is over.

Don't ask me to explain why you have to put <head> in front of the <title> tag and </head> after the </title> tag. You just do. (Hour 22, "Organizing and Managing a Web Site," reveals some other advanced header information that can go between <head> and </head> , but none of it is necessary for most Web pages.)

Share ThisShare This

Informit Network