1. Home
  2. Computing & Technology
  3. Web Design / HTML

<img />

By Jennifer Kyrnin, About.com

<img /> Description:

The <img /> element adds images and graphics to Web pages.

<img /> Web Browser Support:

<img /> Attributes:

<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.

More <img /> Information:

Return to XHTML Element (HTML Tags) Lihrary

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. HTML and XHTML
  5. XHTML
  6. HTML Tags
  7. The img Element - Images Web Graphics - XHTML 1.0 HTML 4.0

©2008 About.com, a part of The New York Times Company.

All rights reserved.