| Version | W3C//DTD HTML 3.2 Final//EN
|
|---|
| Element | IMG |
|---|
| Purpose | image; photo, icon, glyph, or illustration |
|---|
| Description | This element places an image in a document. The alt attribute is used to display a string of text when the image can not be displayed (e.g., in non-graphical browsers).
Note that it is a good idea to fill in the alt attribute so that users with non-graphical browsers can gain information. For example, when the image conveys information not explained in the text or the image is used in an anchor.
|
|---|
| Start tag | Required <IMG>
|
|---|
| Attributes | | Name | Type | Default | Comment |
|---|
| align | ( top | middle | bottom | left | right ) | #IMPLIED | vertical or horizontal alignment | | alt | CDATA | #IMPLIED | for display in place of image | | border | NUMBER | #IMPLIED | integer representing length in pixels; suggested link border width in pixels | | height | NUMBER | #IMPLIED | integer representing length in pixels; suggested height in pixels | | hspace | NUMBER | #IMPLIED | integer representing length in pixels; suggested horizontal gutter in pixels | | ismap | ( ismap ) | #IMPLIED | use server image map | | src | CDATA | #REQUIRED | Uniform Resource Locator; see RFC1808 and RFC1738; url of image to embed | | usemap | CDATA | #IMPLIED | Uniform Resource Locator; see RFC1808 and RFC1738; use client-side image map | | vspace | NUMBER | #IMPLIED | integer representing length in pixels; suggested vertical gutter in pixels | | width | NUMBER | #IMPLIED | integer representing length in pixels; suggested width in pixels
|
|
|---|
| Content | EMPTY
|
|---|
| End tag | Forbidden
|
|---|
| Referenced in | A ADDRESS APPLET B BIG BLOCKQUOTE BODY CAPTION CENTER CITE CODE DD DFN DIV DT EM FONT FORM H1 H2
H3 H4 H5 H6 I KBD LI P PRE SAMP SMALL STRIKE STRONG SUB SUP TD TH TT U VAR
|
|---|
| Example | | Source | Appearance |
|---|
<IMG Src="http://www.december.com/html/images/icon.gif" alt="logo for the HTML Station" align="middle"> Visit us today!
<P>
<IMG Src="http://www.december.com/html/images/icon.gif" alt="logo for the HTML Station" align="bottom" width="100" height="200" border="5"> Meeting your hypertext needs since 1996.
<P>
<MAP Name="mymap">
<AREA Shape="rect" Coords="0,0,100,50" Href="http://www.december.com/html/">
</MAP>
<IMG Src="../../images/icon.gif" Usemap="#mymap" Width="100" Height="100" Ismap>
| Visit us today!
Meeting your hypertext needs since 1996.
|
|
|---|