![]() |
Lists | Fonts | Formats | Images | Links |
![]() |
|
Everybody loves to add pictures to their work. And with good reason, too. Images can make your web page much more dynamic, and can catch a reader's attention so that they'll stay for the rest. But, there are a couple of important image-related issues you should know about before you start rackin' up them photos of your cat. First, you have to know that there are only a few types of images that can work on web pages [and a good thing too - I would really hate waiting for a bitmap to download]. HTML [and your friendly neighbourhood browser] only supports two kinds of image files at the moment, GIF files, and JPG files [pronounced jif and jay-peg respectively]. The JPG format is best for photographs, because it can display millions of colours, but the GIF format is best for artwork, as it only displays 256 colours at any given time [some programs let you set what's called the "colour index" for the file, and that means that you can decide which 256 colours the image can display]. Another, and probably more important issue to be aware of, is file size. When your browser displays a page, it first has to download that page from the server. It also has to download all the pictures and stuff that you have on the page. When all is said and done, your page might be 20K. That's alright. But if you have 6 JPG files on your page at 800K each, that's getting kind of big. Your average 56K per second connection actually only gives you 1K or 2K per second. That means that an 800K image will take 400 seconds to download, plus the page itself, plus the other 5 images at 800K each. Most of your audience will either be asleep, dead from boredom, or long-gone to somebody else's site once the page finally renders. The pictures don't have to be small in terms of pixel size, but getting the file size down is a must. I should also mention that GIF files usually wind up being smaller than JPG files.
Now that you know a little bit about images, it's time to learn how to include those bad boys in your page. For that, you need the
That little chunk of code will display a picture of me in the appropriate place on your page [the appropriate place being where you decide to insert the tag]. Let's dissect the url in that tag: obviously the http://www.vestige.org bit signals that the browser has to look on the site called "vestige.org" out there on the world wide web. The /frames/info/ bit signals to the browser that it must look in the sub-directories called "frames", and "info". And, of course, the gus.jpg portion tells the browser that the file it's looking for is a JPG file called "gus". When setting up images, you have to remember that urls and file names, unlike the HTML tags themselves, are case-sensetive. That means you have to watch what you type, and be extra careful not to get the url of the image wrong.
There are a couple of other handy attributes. For example, if you know the dimensions of the image you are using, you can include them in the tag and your image will load faster, and the page will re-arrange itself faster to incorporate the image. However guessing if you don't know the actual size of the image can lead to some really ugly looking pictures. The attributes necessary for that are the Lastly, there is the
That was easy, wasn't it?
Before we move on, I just want to let you know that the You can also add backround images to your web page [this works for tables too, so keep it in mind later on]. In the Now we're going to move on to one of the coolest features of HTML, the hyper-links [and nobody calls them that anymore - they just call them "links"]. |
|