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
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.
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.]
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.
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.)
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.
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.]
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.
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.
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.]
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]
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.]
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.
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.]
The ALT attribute is now a required attribute in HTML 4.0. In
previous versions it was not. While the attribute is not necessary
for rendering the specified image, it is good practice to always
provide an ALT attribute - it allows the element to degrade gracefully
on browsers that do not support images or have them turned off.
DTD Note: Support for the NAME attribute was added
to HTML 4.01 and did not exist in the original HTML 4.0 DTDs. HTML 4.x+
recommends that authors use the ID attribute instead wherever possible,
since that will be the accepted method moving forward.
If you decide to use any of the Internet Explorer specific IMG
attributes, ALWAYS use an alternate SRC attribute as well to
allow for graceful degradation on browsers that do not support these
attributes (which is every browser but Internet Explorer.)
The ALIGN attribute has two sets of orthogonal behavior types
bundled together: Floating horizontal alignment and in-line vertical
alignment relative to surrounding text. There really doesn't seem to
be a need to specify both types because in each situation, the other
type of attribute is not necessary.
Never specify a LOWSRC attribute without specifying a SRC attribute.
Specifying a BORDER of 0 on an image embedded in a hyperlink may
confuse users who use this attribute to visually identify hyperlinks.
In the past, it was recommended to use the USEMAP attribute in
conjunction with the ISMAP attribute since ISMAP had greater historical
support. Client-side image maps have been supported in browsers now since
late 1995, and this recommendation is not as necessary as it used to be.
Nowadays it should be sufficient to use only a client-side image map along
with an alternative that allows for text-only navigation and you should be safe.
If you use the ISMAP attribute, always remember to include an alternate
navigation method for users that are not using an image-capable browser.
If you use a Width or Height attribute alone without the other
attribute, the image will be scaled at the same aspect ratio based
upon the provided single attribute.
Tip: Always remember that a page high in image content can take
quite a long time to load depending on the power and speed of the
connection, equipment and network load. People can become impatient
and stop downloading in such cases, thus your page will never be read.
Strive to control the physical size and quantity of images in your pages.
FAQ: What is the
'NATURALSIZEFLAG' attribute that can
sometimes be found in HTML documents? Quick
Answer: An unnecessary attribute added by the Adobe SiteMill/PageMill
HTML editors. A more in-depth
answer has also been compiled.
Browser Peculiarities
Support Note: Mosaic supported the BORDER,
HEIGHT and WIDTH attributes to the IMG element in the Macintosh
3.0 Betas, but retracted it for its final PC version.
Internet Explorer and Netscape also seem to support a value
for ALIGN called 'center'. This value gives the same results as
the value of 'middle' which vertically aligns the centerline of
an image to the centerline of the surrounding text. Best bet is
to use the legal value of 'middle'.
Internet Explorer 3.0 and above, and Netscape 1.0 and above
also support percentage values for the HEIGHT and WIDTH attributes.
Some older browsers may not support the floating capabilities
offered by the ALIGN attribute (such as Mosaic versions below 3.0)
Vertical alignment relative to the line is historically much more widespread.
[Test]
Netscape has never supported external IDs/URLs in the USEMAP attribute
to the IMG element as per the specification (only internal anchors can
be used.) Internet Explorer supports external IDs/URLs from version 1.0
to 3.0, now it does not support them. Opera has supported external
IDs/URLs since version 3.0.
[Test]Thought you might like to know: All
the browsers surveyed also support another form of this element (which
is not a part of ANY HTML standard.) The string
"IMAGE" can replace "IMG". Internet Explorer supports
this since version 1.0, Mosaic since at least 2.1, and Netscape since
version 1.1. Internet Explorer did not support this in v4.0 Beta 1
(presumably because the parser/rendering engine for 4.0 was re-built
from scratch), but the strange syntax is again recognized in 4.0 Beta 2.
[Test]
If an image is used as an image map in a document, the coordinates
specified in the AREA elements must represent the coordinates on
the image AS IT WILL BE USED in the document. Eg: if different
HEIGHT and/or WIDTH attributes are specified in the IMG element the
map coordinates must reflect this. Take care - if percentage heights
and widths are specified, it will be almost IMPOSSIBLE to
give accurate coordinates in the client side image map. This warning
applies to all browsers surveyed that support client-side image maps.
[Test]
Netscape does not seem to adjust the dimensions of an image if a
LOWSRC attribute is also supplied, ie: The dimensions of the LOWSRC
image are used to render the SRC image if no other HEIGHT and WIDTH
properties have been set.
[Test]
Setting either of the WIDTH or HEIGHT attributes to zero does strange
things. In Netscape 4, this causes the image to be displayed at its
natural dimensions. In Internet Explorer 4 the image disappears. The odd
thing is, in previous versions of these browsers the behavior is reversed.
The SUPPRESS attribute in Netscape 4 appears to be somewhat buggy, but
it does appear to work. One of my tests tried suppressing placeholders
with WIDTH and HEIGHT also specified, and the behavior failed. Be sure
to test this behavior well before you use this attribute in pages you
author. For official reference on this attribute, see
http://developer.netscape.com/docs/manuals/htmlguid/tags8.htm.
[Test]
Linefeed and Carriage Return handling ( and
respectively) for the ALT attribute:
- Internet Explorer: All literal/unencoded or
encoded CR/LFs are maintained and displayed as intended.
- Netscape: All unencoded or encoded CR/LFs are
collapsed to nothing in ALT display (not the normal method for
spacing-character collapsing - usually it would collapse to a
single space.)
- Opera: When the SRC attribute is unavailable,
ALT contents are displayed; unencoded CR/LFs are collapsed to a
single space, while Encoded entities are honored and displayed as
intended.
Support for the LOWSRC attribute was not added to Mozilla/Netscape 6
until Beta 2 - Beta 1 did NOT support LOWSRC. Update: LOWSRC support in Mozilla has now been deleted, starting
in Netscape 6.1. (See Bugzilla 92453)
The LONGDESC attribute is exposed in Netscape 6.1+ by invoking a context
menu on the image (PC: right clicking) and choosing "properties."