Share this Page URL

Chapter 6. A Picture Is Worth a Thousand... > Images: Some Semi-Important Backgrou... - Pg. 64

A Picture Is Worth a Thousand Clicks: Working with Images 64 Okay, enough of all that. Let's get the lead out and start squeezing some images onto our web pages. As I mentioned earlier, there's an HTML code that tells a browser to display an image: the <IMG> tag. Here's how it works: <IMG SRC="filename"> Here, SRC is short for "source" and filename is the name of the graphics file you want to display. For example, suppose you have an image named logo.gif. To add it to your page, you use the following line: <IMG SRC="logo.gif"> In effect, this tag says to the browser, "Excuse me? Would you be so kind as to go out and grab the image file named logo.gif and insert it in the page right here where the <IMG> tag is?" Dutifully, the browser loads the image and displays it in the page. For this simple example to work, bear in mind that your HTML file and your graphics file need to be sitting in the same directory on your computer, assuming you're just testing things at home. (When you put your page online (see the next chapter), you have to send the image file to your web host and make sure it's in the same directory as your HTML file.) Webmaster Wisdom