Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

A Simple Sample Page

Figure 2.1 shows the text you would type and save to create a simple HTML page. If you opened this file with a Web browser such as Netscape Navigator, you would see the page in Figure 2.2.

02fig01.gif

Figure 2.1 Every Web page you create must include the <html>, <head>, <title>, and <body> tags.

02fig02.jpg

Figure 2.2 When you view the Web page in Figure 2.1 with a Web browser, only the actual title and body text are displayed.

In Figure 2.1, as in every HTML page, the words starting with < and ending with > are actually coded commands. These coded commands are called HTML tags because they "tag" pieces of text and tell the Web browser what kind of text it is. This allows the Web browser to display the text appropriately.

An HTML tag is a coded command used to indicate how part of a Web page should be displayed.

Before you learn what the HTML tags in Figure 2.1 mean, you might want to see exactly how I went about creating and viewing the document itself:

  1. Type all the text in Figure 1.1, including the HTML tags, in Windows Notepad (or Macintosh SimpleText).
  2. Select File, Save As and be sure to select Text Documents as the file type.
  3. Name the file myfirst.html . (If you're using a Windows 3.1 or DOS program, you need to name it myfirst.htm instead because those old operating systems are too prudish to handle filenames ending in four-letter words.)
  4. Choose the directory folder on your hard drive where you would like to keep your Web pages—and remember which one you choose! Click the Save or OK button to save the file.
  5. Now start up Netscape Navigator or Microsoft Internet Explorer. (Leave Notepad running, too. That way you can easily switch back and forth between viewing and editing your page.)
  1. In Microsoft Internet Explorer 5, select File, Open and click Browse. If you're using Netscape Navigator 4 or 5, select File, Open Page and click the Choose File button. Navigate to the appropriate folder and select the myfirst.html file.

    Voilá! You should see the page in Figure 2.2.

Share ThisShare This

Informit Network