(See 03-21-13 for HTML Part 3)
Okay, that will get you an image on a Web page which is a little like turning a bull loose in a china shop. Next we need to learn to control it. First we need to give it a title in case, horror of horrors, it somehow fails to load. We use the "ALT" attribute to do this, adding ALT="My greatest masterpiece." This would follow the above image tag inside the same < and > marks. This title is useful for slow loading images to give the viewer something to read over and over again until the picture arrives. It used to be important for "text only" browsers but since the last one of those was long ago consigned to the Smithsonian, that's of little consequence now.
Now that we've given our raging bull a name, we must confine it to a certain size. This is done by telling the browser, in pixels, how big to make the picture. One inch equals 96 pixels, by the way. We would simply assert WIDTH="600" HEIGHT="400" right after the ALT tag still inside the same set of < >. To avoid image distortion, be sure to keep the width to height ratio the same as that of the original image (3:2 in this case). The thing to remember here is to keep the image on file about the same size as called for in the HTML file. If the image on file is smaller than what's called for, the resolution of the page image suffers, and if it is larger, the loading time will be greater than necessary. The actual size the artist chooses to use would be determined by the amount of detail in the picture and the page layout itself. With today's broadband, downloading time is not the constant consideration it once was.
And finally, training the bull, in effect, telling him "where to go," involves the attributes ALIGN="left" (default) ALIGN="center", or ALIGN="right". These also are placed inside the image tag, usually at the end, and are pretty self-explanatory; but are best used with a healthy dose of trial and error in that text placement may be influenced by their use. (One rule to always remember is that anything immediately following the "=" symbol should always be within quotation marks.) Thus, the complete image tag would read:
This, of course, only covers the horizontal placement of the image and there are, indeed, instructions for vertical alignment but they are so complex and so seldom used today they are no longer important enough to be worth learning. Vertical control especially, and indeed, horizontal image placement as well, is almost always handled by the use of TABLES. And they will not be the subject of our next learned discourse. Instead, we'll deal with LINKS. Golf anyone?
This, of course, only covers the horizontal placement of the image and there are, indeed, instructions for vertical alignment but they are so complex and so seldom used today they are no longer important enough to be worth learning. Vertical control especially, and indeed, horizontal image placement as well, is almost always handled by the use of TABLES. And they will not be the subject of our next learned discourse. Instead, we'll deal with LINKS. Golf anyone?
No comments:
Post a Comment