IMG Tag (HTML Code for Pictures)
The <img> tag gives us graphical capabilities and helps make cool html code. The web allows us to share any graphical image as long as it is a .GIF or a .JPG file. The <img> tag does not use a closing tag. A cute graphic can really enhance your web site.
Syntax
<IMG
- src="url" width=xxx height=xxx align=position border=xx alt="description" hspace=xx vspace=xx usemap="url">
Modifiers
- SRC=URL
- The URL is the location and filename of the image file. This address can be an absolute web address or a relative address within the web site.
- WIDTH=number
- Width, in either pixels or the percentage of the screen (ie; 80%).
- HEIGHT=pixels
- The actual height of the image in pixels.
- ALIGN=position
- The align modifier controls the horizontal location, with respect to the field the item resides in. Options can be LEFT, CENTER or RIGHT.
- BORDER=pixels
- Builds a frame around the picture the width of the number of pixels. BORDER=0 would put no border around the image.
- ALT=Description
- This is the alternate description for people without graphical browsers (the blind). It
is also noted by the Search Engines. - TITLE=Description
- This is much like the alternate description.
- HSPACE=pixels
- HSPACE is the amount of horizontal spacing between the picture and any surrounding text.
- VSPACE=pixels
- VSPACE is the amount of vertical spacing between the picture and any surrounding text.
- USEMAP=NAME
- The NAME is defined by the <MAP></MAP> tags and should match the graphic as well. See the <AREA> tag for more information.
Tips
- URL
- The URL of the image can be located by a relative address (../pics/image.gif) or by an absolute address (http://www.nampa.net/pics/line.gif).
- WIDTH or HEIGHT
- The actual values can be determined by looking at them with a browser. Incorrect values can be used, but distort the picture. If left out, the browser can determine the values, but on a complex page it can take a noticable amount of time.