Image
 
Support Key: [2|3|3.2|4] [X1|X1.1] [IE1|M1|N1|O2.1]
What is it?
Attributes
Tag Example
Parent/Content Model
Tips & Tricks
Browser Peculiarities
= Index DOT Html by Brian Wilson =
Main Index | Element Tree | Element Index | HTML Support History



   Quick Statistics   
End Tag:
   Omitted
Standards Details:
HTML: In all 4.x DTDs
XHTML: In all 1.0 and 1.1 DTDs
XHTML Modules:
Image
CSS 'display' Type:
"inline" (replaced element)
CSS Mapping:
NA
Default Rendering:
Replaced by image of specified dimensions
Official Docs:
HTML 4.x, XHTML 1.1
What is it?
The IMG element is the main method for including multimedia content in an HTML document, accomplished via in-line graphics.

Common Attributes
%Core%
[2|3|3.2|4] [X1|X1.1] [IE4B1|M|N6B1|O3.5]
%Accessibility%
[2|3|3.2|4] [X1|X1.1] [IE4B1|M|N6|O5]
%Events%
[2|3|3.2|4] [X1|X1.1] [IE4B1|M|N3|O3]
%Language%
[2|3|3.2|4] [X1|X1.1] [IE4|M|N|O]
%Data%
[2|3|3.2|4] [X1|X1.1] [IE4|M|N|O]
%Editing%
[2|3|3.2|4] [X1|X1.1] [IE5.5|M|N|O]

Specific Attributes
Align
[2|3|3.2|4] [X1|X1.1] [IE1|M1|N1|O2.1]
Standards Details: Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of CSS.
Required? No
Description:
This attribute specifies the alignment of text following the IMG reference relative to the graphic on screen. LEFT and RIGHT specify floating horizontal alignment of the image in the browser window, and subsequent text will wrap around the image. The other options specify vertical alignment of text relative to the image on the same line.
Values: Left | Right | Top | Texttop | Middle | Absmiddle | Baseline | Bottom | Absbottom
Alt
[2|3|3.2|4] [X1|X1.1] [IE1|M2|N1|O2.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? Yes
Description:
This is text to be displayed in place of an image for browsers that can not handle this ability or for browsers that have disabled this ability.
Values: CDATA.
Border
[2|3|3.2|4] [X1|X1.1] [IE1|M3B2*|N1|O2.1]
Standards Details: Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of CSS.
Required? No
Description:
This controls the thickness of the border around the image (in pixels) whether as a hyperlink or as a stand-alone image. If the image is stand-alone, the border color will usually be the color of the surrounding text (affected also by the TEXT attribute to the BODY element.) If the image is within a hyperlink the border color will the default hyperlink color (affected also by the LINK/VLINK attributes to the BODY element.)
Values: CDATA. [0, for no border, or a positive integer pixel value.]
Controls
[2|3|3.2|4] [X1|X1.1] [IE2|M|N|O]
Standards Details: NA
Required? No
Description:
This standalone attribute specifies a set of video controls be available to the user in order to allow the user the ability to pause, stop, re-start or skip parts of the video. It is used in conjunction with the DYNSRC attribute.
Values: NA
DynSrc
[2|3|3.2|4] [X1|X1.1] [IE2|M|N|O2.1]
Standards Details: NA
Required? No
Description:
This attribute specifies the URL of an in-line video.
Values: Either an absolute or relative URL. All URLs should be URL encoded where required.
Height
[2|3|3.2|4] [X1|X1.1] [IE1|M3B2*|N1|O2.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This attribute explicitly specifies the height of the graphic in pixels. It is mainly used to create custom image dimensions without physically changing the image itself. It can also be used to speed up display of the document being downloaded so it can pre-render the document with image placeholders while the images download.
Values: CDATA. [Positive integer pixel values or positive integers paired with a "%" character denoting a percentage of the parent element height.]
HSpace
[2|3|3.2|4] [X1|X1.1] [IE1|M|N1|O2.1]
Standards Details: Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of CSS.
Required? No
Description:
This attribute specifies the horizontal spacing around images in pixels (left and right side padding.)
Values: CDATA. [Positive integer pixel values]
ISMap
[2|3|3.2|4] [X1|X1.1] [IE1|M1|N1|O2.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This is a stand-alone attribute which is used in combination with a hyperlink to identify the image as a sensitive map. When used in combination with a hyperlink whose destination is a coordinate map file, the browser sends the coordinates clicked on by the user to the map file for processing.

The map file is a series of shape names with associated coordinate values that list corresponding URLs to jump to when the coordinates are received.
Values: NA (HTML); ismap (XHTML)
Longdesc
[2|3|3.2|4] [X1|X1.1] [IE|M|N6.1|O]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This attribute specifies the URL of a longer description of the image specified in the SRC attribute. This would allow long passages of descriptive narrative with markup to be used for image descriptions.
Values: CDATA. [Either an absolute or relative URL. All URLs should be URL encoded where required.]
Loop
[2|3|3.2|4] [X1|X1.1] [IE2|M|N|O2.1]
Standards Details: NA
Required? No
Description:
This attribute specifies the number of times the video will play. This attribute is used in conjunction with the DYNSRC attribute.
Values: Specified as a positive integer, or Infinite (or -1) which will play the video indefinitely.
LowSrc
[2|3|3.2|4] [X1|X1.1] [IE4B1|M|N1-6.01|O]
Standards Details: NA
Required? No
Description:
This attribute specifies the URL of a low-resolution image to be downloaded before a higher resolution image specified in the SRC attribute. The reasoning is that a low-resolution image is smaller in size than a higher resolution image and is thus faster to download. After the lowres image has been downloaded, it is displayed until the high resolution image is downloaded.
Values: Either an absolute or relative URL. All URLs should be URL encoded where required.
Name
[2|3|3.2|4] [X1|X1.1] [IE4|M|N3|O3]
Standards Details: Introduced in HTML 4.01. In all HTML 4.01 DTDs. In Transitional/Frameset DTDs (not in Strict) in XHTML 1.0. Dropped in XHTML 1.1 in favor of the ID attribute.
Required? No
Description:
This attribute is used to give a unique label to this image so that it can be referenced and manipulated with scripting code.
Values: CDATA
SDAPref
[2|3|3.2|4] [X1|X1.1] [IE|M|N|O]
Standards Details: NA
Required? No
Description:
This is an SGML Document Access (SDA) attribute. SDA attributes are designed to transform HTML (and other SGML-based documents) to the ICADD DTD - which is used in creating accessible documents for users with visual disabilities (rendering in Braille, large print, speech synthesis, etc.) The attribute value specifies content to be added BEFORE the original element content (in this case the string "<Fig><?SDATrans Img: #AttList>#AltVal(Alt)</Fig>") when the SDA document is rendered (SDA also allows attributes and values from the original element to be used in the new SDA element where necessary.) #AttList lists out all of the attribute="value" pairs from the original code, and #AltVal(Alt) echoes the value of the original IMG ALT attribute.
Value: "<Fig><?SDATrans Img: #AttList>#AltVal(Alt)</Fig>
Src
[2|3|3.2|4] [X1|X1.1] [IE1|M1|N1|O2.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? Yes
Description:
Indicates the URL to reference the graphic.
Values: CDATA. [Either an absolute or relative URL. All URLs should be URL encoded where required.]
Start
[2|3|3.2|4] [X1|X1.1] [IE2|M|N|O]
Standards Details: NA
Required? No
Description:
This attribute specifies when the video will start playing. This attribute is used in conjunction with the DYNSRC attribute.
Values:
   Fileopen [The video starts as soon as it is finished loading]
   Mouseover [The video should start playing when the user moves the mouse over the video clip.]
Suppress
[2|3|3.2|4] [X1|X1.1] [IE|M|N4-4.x|O]
Standards Details: NA
Required? No
Description:
Most browsers display a special icon (which may also display the ALT attribute content) in place of an actual image until the real image is finished being downloaded. This attribute specifies whether or not this image placeholder will be displayed.
Values:
True [Suppress image placeholders and ALT content]
False [Do not suppress image placeholders and ALT content - DEFAULT]
UseMap
[2|3|3.2|4] [X1|X1.1] [IE1|M2.1|N2|O2.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This attribute specifies the URL (usually internal to the document) of the client-side image map specification to be used if the browser has that capability. If the argument to USEMAP begins with a "#" it is assumed to be in the same document as the IMG element. This attribute is well used in conjunction with the ISMAP attribute for browsers that cannot understand client-side image maps. Client-side coordinate mapping is done by the browser, so is inherently faster in processing the coordinates than the ISMAP process. The presence of a USEMAP attribute overrides the effect of an anchor (A) element surrounding the IMG element.
Values: CDATA. [An absolute URL, a relative URL or an internal anchor name. All URLs should be URL encoded where required.]
VRML
[2|3|3.2|4] [X1|X1.1] [IE2|M|N|O]
Standards Details: NA
Required? No
Description:
This attribute specifies the URL of an inline VRML world. Use of this attribute will launch a VRML viewer if one is installed on the machine.
Values: Either an absolute or relative URL. All URLs should be URL encoded where required.
VSpace
[2|3|3.2|4] [X1|X1.1] [IE1|M|N1|O2.1]
Standards Details: Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of CSS.
Required? No
Description:
This attribute specifies the vertical spacing around images in pixels (top and bottom padding.) Values are specified in positive integers.
Values: CDATA. [Positive integer pixel values]
Width
[2|3|3.2|4] [X1|X1.1] [IE1| M3B2*|N1|O2.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This attribute explicitly specifies the width of the graphic in pixels. It is mainly used to create custom image dimensions without having to physically change the image itself. It can also be used to speed up display of the document being downloaded so it can pre-render the document with image placeholders while the images download.
Values: CDATA. [Positive integer pixel values or positive integers paired with a "%" character denoting a percentage of the parent element width.]
Example
<img src="http://www.foo.com/foo.gif" align="left"
alt="alternate text" height="20" width="30"
dynsrc="http://www.foo.com/foo.avi" start="fileopen"
loop="infinite" border="3" />
Parent Model
%In-line Parent% | %Block Parent%
Content Model
This element does not accept any content.
Tips & Tricks Browser Peculiarities
Boring Copyright Stuff...