How a Web Page Works

When you write a Web page, no matter how you go about it, what you really end up with is an HTML file that can be published on a Web server.

An HTML file (see Figure 17.4) contains all the text that appears on the page, plus HTML tags.

Figure 17.4. The HTML source file of the page shown in Figure 17.1.


Tags are codes in an HTML file that tell a browser what to do. For example, if the tag <b> appears before a word and the tag </b> appears after the word, those tags tell browsers to show that word in bold type when displaying the page.

Besides controlling the formatting of the page, the tags in an HTML file label each chunk of text as a particular element of the page. For example, HTML tags identify one line of text as the page's title, blocks of text as paragraphs, certain lines or words as links, and so on. Other HTML tags designate the filenames of inline images to be incorporated into the page by the browser when the page is displayed.

A Web browser is a program that knows how to do at least two things:

  • Retrieve HTML documents from remote Web servers (by using a communications protocol named HTTP, about which you need to know nothing right now)

  • Interpret the HTML tags in the document to display a heading as a heading, treat a link like a link, and so on

What's important to remember is that the HTML tags do not offer you the kind of control over the precise formatting of a page that you would have in a word processor. HTML mostly just identifies what's what. Each browser decides differently how to format those elements onscreen, though the two major browsersNetscape and Internet Explorertend to show most Web pages almost identically.

Extensions are special additions to the standard HTML language, usually created by a browser maker to enable that browser to do tasks not included in HTML. See "Extensions: Love 'Em!, Hate 'Em!," later in this chapter.

At the time of this writing, the two most popular browsersvarious versions of Netscape Navigator and Internet Explorercomprise the overwhelming majority of the browser market. Although subtle differences exist in the HTML tags each one supports, the perpetual competition between these two has resulted in two browsers that display most Web pages identically. To most potential visitors on the Web, therefore, your Web page will look roughly the same as it does to you in Netscape as you work on it.

To folks using browsers other than the two big shots, your page will always show the same text content and general organization, but its graphical content and other aesthetics might vary dramatically from browser to browser. In fact, in some cases, pictures and any other graphical niceties might not even show up.

To illustrate this browser-to-browser variation, Figures 17.5 and 17.6 show exactly the same Web page as shown earlier, in Figure 17.1. That figure, however, displays the page through Netscape, and Figures 17.5 and 17.6 show it through two other browsers: Opera and DosLynx, respectively. Compare these two figures and observe how the presentation differs in each one.

Figure 17.5. The same page as shown in Figure 17.1 is shown in Opera.


Figure 17.6. The same page, as shown in Figures 17.1 and 17.5, shown in DosLynx.


DosLynx, the browser shown in Figure 17.6, is a text-only browser for DOS. (You remember DOS, don't you?) Disappearing rapidly from the Web (but still out there), these browsers cannot display inline graphics and display all text in the same-size typeface, although important elements, such as headings, can be made to stand out with bold type or underlining. Some people use text-only browsers out of choice, although most people do so because they lack the proper type of Internet account or the proper hardware for a graphical browser.


In addition to those using text-only browsers, others online can't see graphics because they have used the customization features in their browsers to switch off the display of graphics (which speeds up the display of pages).

Although text-only browsers have all but disappeared, as a new Web author, you should keep in mind the possibility that some folks can't see the pictures in your pages. For them, you need to make sure that the text in the page gets the job done, whether the pictures appear or not.

Try it yourself.

  1. View any Web page through your Web browser, as shown in Figure 17.7.

    Figure 17.7. Step 1: View any page.


  2. Change the view of your browser so that it shows the raw HTML source code of the page (see Figure 17.8):

    Figure 17.8. Step 2: Choose a menu item that displays the HTML source code of the page you're viewing.


    In Netscape, choose View, Page Source.

    In Internet Explorer, choose View, Source.

    In another browser, look for a menu option that mentions Source or HTML.

  3. Explore the HTML code (see Figure 17.9). Don't worry if lots of it look like gibberishyou don't really need to be able to "decode" an HTML file on sight. But if you look closely, you see the following within the various codes:

    • The actual text that appears on the page

    • Filenames of pictures in the page

    • Web addresses to which the links point

    Figure 17.9. Step 3: Explore the code, just to get a feel for what a Web page is really made of.


  4. When finished examining the HTML source code, close the window in which the code appears so that the browser returns to its normal view.

Sams Teach Yourself Internet and Web Basics All in One
Sams Teach Yourself Internet and Web Basics All in One
ISBN: 0672325330
EAN: 2147483647
Year: 2003
Pages: 350
Authors: Ned Snell © 2008-2017.
If you may any questions please contact us: