Version-//W3C//DTD XHTML 1.0 Strict//EN
Elementimg
PurposeEmbedded image
DescriptionThis 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 tagRequired <img />
Attributes
NameTypeDefaultComment
alt CDATA #REQUIREDtext used for titles; short description
class CDATA #IMPLIEDspace-separated list of classes
dir( ltr | rtl )#IMPLIEDdirection for weak/neutral text
height CDATA #IMPLIEDnn for pixels or nn% for percentage length; override height
idID#IMPLIEDdocument-wide unique id
ismap( ismap )#IMPLIEDuse server-side image map
langNMTOKEN#IMPLIEDlanguage code (backwards compatible); language code as RFC3066
longdesc CDATA #IMPLIEDUniform Resource Identifier as per RFC2396; a Uniform Resource Locator (URL) is a URI; link to long description (complements alt)
onclick CDATA #IMPLIEDa pointer button was clicked; script expression
ondblclick CDATA #IMPLIEDa pointer button was double clicked; script expression
onkeydown CDATA #IMPLIEDa key was pressed down; script expression
onkeypress CDATA #IMPLIEDa key was pressed and released; script expression
onkeyup CDATA #IMPLIEDa key was released; script expression
onmousedown CDATA #IMPLIEDa pointer button was pressed down; script expression
onmousemove CDATA #IMPLIEDa pointer was moved within; script expression
onmouseout CDATA #IMPLIEDa pointer was moved away; script expression
onmouseover CDATA #IMPLIEDa pointer was moved onto; script expression
onmouseup CDATA #IMPLIEDa pointer button was released; script expression
src CDATA #REQUIREDUniform Resource Identifier as per RFC2396; a Uniform Resource Locator (URL) is a URI; URI of image to embed
style CDATA #IMPLIEDassociated style info; style sheet data
title CDATA #IMPLIEDadvisory title; text used for titles
usemap CDATA #IMPLIEDUniform Resource Identifier as per RFC2396; a Uniform Resource Locator (URL) is a URI; use client-side image map
width CDATA #IMPLIEDnn for pixels or nn% for percentage length; override width
xml:langNMTOKEN#IMPLIEDlanguage code (as per XML 1.0 spec); language code as RFC3066
ContentEMPTY
End tagForbidden
Referenced in a abbr acronym address b bdo big button caption cite code dd del dfn div dt em fieldset h1 h2 h3 h4 h5 h6 i ins kbd label legend li object p q samp small span strong sub sup td th tt var
Example
SourceAppearance
<p><img src="http://www.december.com/html/images/icon.gif" alt="logo for the HTML Station" /> Visit us today!</p>
<p><img src="http://www.december.com/html/images/icon.gif" alt="logo for the HTML Station" width="100" height="200" />
Meeting your hypertext needs since 1996.</p>
<p><map name="mymap" id="mymap">
<area shape="rect" coords="0,0,100,50" href="http://www.december.com/html/" alt="The HTML Station" /></map>
<img src="../../images/icon.gif" usemap="#mymap" width="100" height="100" ismap="ismap" alt="imagemap" /></p>

logo for the HTML Station Visit us today!

logo for the HTML Station Meeting your hypertext needs since 1996.

The HTML Station imagemap

Save this page to any social bookmarking site! Share · Search · Market · Directory
2015-11-01 · John December · Contact · Terms of Use © December Communications, Inc.