Navigation Button

Internet Brothers: Helpware for the Cybercommunity - HTML Basics

Manipulating Images

Way back in Lesson 3 we showed you how to manipulate text placement on your page. If anything, it's even easier to do with images. As with text, if you don't specify, the default is to align an image on the left of a page. You can, however, place them on the right or in the center.

<img src="dnc.gif" align="left">

<img src="cbs.gif" align="center">

<img src="rnc.gif" align="right">

Again as with text, you may resize images with HTML tag attributes. Image files on a computer monitor are made up of thousands of picture elements, or "pixels", for short. In general, most images on the Web are generated with a depth of 72 by 100 pixels per inch. There are different ratios of course, that produce varied quality of output. You needn't concern yourself with that here, just suffice it to say that modern graphics editing software has LOTS of options.

To resize images on your page you use the WIDTH and HEIGHT attributes of the IMG tag. As their names imply, these options allow control of image display size, even dynamically. For an image to display its optimum quality, the attributes you specify must match the actual size of the image. But you can use width and height to shrink or enlarge your graphics. The spade-shaped graphic at left has an actual size of 66 pixels width and 80 pixels height. You can stretch the image in either direction using the appropriate attributes:

<img src="spade.gif" width="100" height="80">

<img src="spade.gif" width="66" height="100">

<img src="spade.gif" width="33" height="40">

As you can see, the false sizes really detract from the image quality. As a general rule, it is better to shrink images, rather than enlarging them. One more item before we go. Another attribute of the IMG tag is ALT or alternate. This enables you to assign a text description to the image. It serves two purposes; 1) it allows visitors with non-graphical browsers (yes, there still are some) to see what would be there, and 2) it opens a tip tool box in the browser that can be filled with any information you like. Hover your mouse over the spade image below to see the ALT text.

ALT attribute demonstration <img src="spade.gif" alt="ALT attribute demonstration">

To us, working with graphic images can be both supremely enjoyable, as well as intensely aggravating. Be prepared to spend a majority of your development agenda in this arena. Please take some time now to review what you've learned today, experiment with it on your web page, utilize your browser's view source feature, then come back and we'll wrap it all up.

HTML Tutorial 7 Move on to Tutorial 7, Summary

Was this site useful to you?
Vote For Us at WebbieWorld

The Internet Brothers have implemented hierarchical menus for navigation. Easier done than said.

The hierarchical menus were created using Peter Belesis' © Dynomat DHTML scripting tool from Webreference. Give them a visit, you'll like what you learn.

Our Lovely Email Icon    another darn bug

 

 

Our Lovely Email Icon    another darn bug






Site Map

 

 

 

 

 

 

If olive oil comes from olives, where does baby oil come from?

 

 

 

 

 

Copyright © 1997-present Internet Brothers. All Rights Reserved. Really.