Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

How Web Pages Work

When you are viewing Web pages, they look a lot like paper pages. At first glance, the process of displaying a Web page is simple: You tell your computer which page you want to see, and the page appears on your screen. If the page is stored on a disk inside your computer, it appears almost instantly. If it is located on some other computer, you might have to wait for it to be retrieved.

Of course, Web pages can do some very convenient things that paper pages can't. For example, you can't point to the words "continued on page 57" in a paper magazine and expect page 57 to automatically appear before your eyes. Nor can you tap your finger on the bottom of a paper order form and expect it to reach the company's order fulfillment department five seconds later. You're not likely to see animated pictures or hear voices talk to you from most paper pages either (newfangled greeting cards aside). All these things are commonplace on Web pages.

But there are some deeper differences between Web pages and paper pages that you'll need to be aware of as a Web page author. For one thing, what appears as a single "page" on your screen may actually be an assembly of elements located in many different computer files. In fact, it's possible (though uncommon) to create a page that combines text from a computer in Australia with pictures from a computer in Russia and sounds from a computer in Canada.

Figure 1.1 shows a typical page as seen by Microsoft Internet Explorer, the world's most popular software for viewing Web pages. The page in Figure 1.1 would look just the same if viewed in Netscape Navigator, which runs a close second in popularity to Microsoft Internet Explorer.

01fig01.jpg

Figure 1.1 A Web browser assembles separate text and image files to display them as an integrated page.

A Web browser such as Internet Explorer does much more than just retrieve a file and put it on the screen. It actually assembles the component parts of a page and arranges those parts according to commands hidden in the text by the author. Those commands are written in HTML.

A Web browser is a computer program that interprets (HTML) commands to collect, arrange, and display the parts of a Web page.

Figure 1.2 shows the text, including the HTML commands, I typed to create the page in Figure 1.1. This text file can be read and edited with any word processor or text editor. It looks a bit strange with all those odd symbols and code words, but the text file itself doesn't include any embedded images, boldface text, or other special formatting.

01fig02.jpg

Figure 1.2 This is the text I typed to create the page in Figure 1.1. The words between < and > are HTML tags.

Internet Explorer adds all the images and formatting you see in Figure 1.1. It reads the coded HTML commands in the text, which tell it to look for separate image files and display them along with the text itself. Other commands tell it which text to display in boldface and how to break up the lines of text on the page.

Share ThisShare This

Informit Network