Links
Home
Email
<IMG>
Description:
The <IMG> tag displays a graphic image. No ending tag is used. You must include at least the SRC attribute to specify the graphic image.
It is generally considered good form to specify the ALT attribute, as this allows people who surf without graphics to understand your web page. In addition, specifying the HEIGHT and WIDTH attributes helps keep your web pages looking better if the image is not found or loaded for some reason.
The <IMG> tag is also used to create image maps.
Attributes:
| align=alignment | |||||||||
Determines how to align the image. May have the
following values:
|
|||||||||
| alt="text" | |||||||||
| Defines text to be displayed (a) while image is loading, and (b) if image cannot be loaded. | |||||||||
| border="n" | |||||||||
| Width of the border of the image in pixels. | |||||||||
| class=class | |||||||||
| Indicates that the image is to be formatted using the specified class. | |||||||||
| coord="coordinates" | |||||||||
The coordinates of the image map elements.
|
|||||||||
| dir=direction | |||||||||
| Indicates the direction (right or left) that the text (in the ALT tag) is to be displayed. Useful for languages which display left to right. | |||||||||
| event=JavaScript | |||||||||
| When event occurs, execute the specified JavaScript. | |||||||||
| galleryimg = "x" | |||||||||
| The value "x" is "yes" or "no" to indicate whether or not to display the image toolbar with the image. This attribute applies to Internet Explorer only. | |||||||||
| id = "name" | |||||||||
| You can give an image a name, which allows it to be referenced and changed in a script (dynamic HTML). | |||||||||
| height="n" | |||||||||
| Height of the image in pixels. | |||||||||
| href="url" | |||||||||
| The URL of the document or object to be retrieved if the image is clicked. | |||||||||
| hspace="n" | |||||||||
| Amount of white space to be inserted to the right and left of an image. | |||||||||
| ismap | |||||||||
| Indicates the image is associated with a server side image map. | |||||||||
| lang="lang" | |||||||||
| Indicates the language of the text within the ALT tag of the image. | |||||||||
| longdesc="url" | |||||||||
| The URL of a file which contains a long text description of the image. This is intended to supplement the description in the ALT tag. | |||||||||
| name="name" | |||||||||
| A name which can be used to reference the image from a style sheet or script. This attribute is included for compatibility only. The ID attribute is prefered. | |||||||||
| shape="shape" | |||||||||
Defines the shape of the image map area, where "shape"
is one of the following:
|
|||||||||
| src="url" | |||||||||
| The URL of the image to be displayed. This may be in the GIF, JPG, PNG or BMP format. | |||||||||
| style="style" | |||||||||
| Defines the style in which the image will be displayed. This overrides any style elements at an "outer" level, such as from the BODY or the Cascading Style Sheet. | |||||||||
| target = "targetwindow" | |||||||||
| This attribute loads the document indicated by HREF into the window as indicated by "targetwindow". | |||||||||
| title="title" | |||||||||
| You can give an image a title if you want. This provides some additional information about it. I'm not sure why you would want to do this, but you could. | |||||||||
| usemap="url" | |||||||||
| Indicates to use a client-side image map. | |||||||||
| vspace="n" | |||||||||
| Amount of white space to be inserted above and below an image. | |||||||||
| width="n" | |||||||||
| Width of the image in pixels. | |||||||||
Examples:
<img border="0" src="http://www.html-reference.com/images |
Internet Tips Contents
404 Errors
Advertising
Autoresponse
Awardmaster
Basics
Browsers
Careers
Chatting
Disasters
Domains
Email
Emoticons
Ezines
Free Stuff
Fun Stuff
FTP
Graphics
Homepages
HTML Reference
HTML Tutorial
Interactive
Legal
Links
Msg Boards
Microsoft
Money
Multimedia
Networks
Newsgroups
Newsletter
Products
RFC's
Ringmaster
Searches
Security
Sticky Sites
Surfing
TANSTAAFL
Telnet
Viral
Webmaster
Your System
