<img /> Description:
The <img /> element adds images and graphics to Web pages.
<img /> Web Browser Support:
- Netscape 1, 2, 3, 4, 6, 7
- Mozilla 1
- Firefox 1
- Internet Explorer 1, 2, 3, 4, 5, 6
- Opera 1, 2, 3, 4, 5, 6, 7, 8
- Safari 1
- WebTV / MSNTV
- AvantGo Palm OS
- AvantGo Windows CE
- HTML 3.2, 4.0
- XHTML 1.0: XHTML Client-Side Image Map Module, XHTML Legacy Module, XHTML Name Identification Module, XHTML Image Module, XHTML Server-Side Image Map Module
<img /> Attributes:
- alt REQUIRED
- align (deprecated)
- class (optional)
- height REQUIRED
- id (optional)
- dir (optional)
- lang (optional)
- longdesc (optional)
- name (optional)
- noshade (deprecated)
- onblur (optional)
- onchange (optional)
- onclick (optional)
- ondblclick (optional)
- onfocus (optional)
- onkeydown (optional)
- onkeypress (optional)
- onkeyup (optional)
- onload (optional)
- onmousedown (optional)
- onmousemove (optional)
- onmouseout (optional)
- onmouseover (optional)
- onmouseup (optional)
- onselect (optional)
- onunload (optional)
- size (deprecated)
- src REQUIRED
- style (optional)
- title (optional)
- usemap (optional)
- width (optional)
<img /> End Tag:
None. <img /> is a singleton tag.
<img /> Contents:
None.
<img /> Valid Context:
The <img /> tag is valid within the following tags:
a, abbr, acronym, address, applet, b, bdo, big, blockquote, body, button, caption, center, cite, code, dd, del, dfn, div, dt, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, i, iframe, ins, kbd, label, legend, li, noframes, noscript, object, p, q, s, samp, small, span, strike, strong, sub, sup, td, th, tt, u, var
<img /> Usage:
- standard image
<img src="/library/graphics/html.gif" width=50 height=50 alt="Your HTML Guide" border="0" />
- an image aligned to the left, with following text
<img src="/library/graphics/html.gif" width="50" height="50" alt="Your HTML Guide" border="0" align="left" /> And this text is to the right of the image
<img /> Special Notes:
- Keep your image file sizes small, so that your pages load quickly.
- Always use the height and width attributes to help your page load quickly.
- Resize images with your graphics editor, not the browser height and width tags.
- Use the alt tag to keep your images accessible.

