If you already know how the browser and server work together to retrieve and display image files , you can skip this lesson.
In the vast time you've squandered surfin' the net, you've no doubt marvelled, as I certainly have, at how well the graphics browser does its job. It really is an amazing piece of software engineering. It manages files, communicates via the modem/winsock to a remote computer (about what it needs), receives, reads, parses, and interprets HTML files, and coordinates with the local operating system to display text and graphics to the monitor. Any one of these tasks is a non-trivial undertaking in software development. Beyond all of this, it provides many operator-friendly features to make using it a pleasant experience. And to top it all off, it works well enough, often enough, to allow us the luxury of taking it for granted.
What makes HTML and the graphics browser unique among software systems, is the ability to handle image files gracefully. Without the robust graphics capability we have come to routinely expect, HTML and the web browser would have long ago been relegated to the archives as "just another good software idea that didn't work out".
In this chapter and the next, we'll focus on the graphics capabilities of the web browser, and how to build HTML files (web pages) that makes the best use of these features.
In HTML, all user-specified images exist as files apart from the web page. Because the HTML file is a text-only file, it cannot contain graphics, but it can contain references to graphics. Therefore, any image to be used by or included in your web page must exist separately as a "file", and it must be accessable by either the browser or the HTTP server at your ISP.
As the browser first reads and parses the incoming HTML file, when it encounters a reference to an image file, it immediately requests that file from the HTTP server at your ISP. The server then returns the image file to the browser, if it is available (or an error if it isn't). If the image file was returned, the browser uses either built-in software or a helper application to extract the graphics information from the file, and display it. If an error was returned, the browser displays a small "uh-oh" image to show you where it would have been if only it had been received. Once the browser has the image file, it continues parsing the HTML file.
As a web page author, your part in all of this is to provide the reference to the image file, by placing the appropriate tags in the HTML File. Also, since images are kept in separate files, it is your responsibility to make sure the image files are accessable. Generally, this means that the image files are transferred to your account's web space at your ISP, along with the HTML file itself.
The lessons in this chapter will detail the tags and methods used to build an HTML file with graphic images.