img

Form

<img src="URL">
<img src="URL" /> (description in XHTML)

Attributes

attribute default description
id none specifies the id name
class none specifies the style class sheet
style none specifies the style sheet
name none specifies the name
src none specifies the URL of the image to be displayed
dynsrc none specifies the URL of the video clip to be played (IE)
width none specifies the width of the image
height none specifies the height of the image
align none specifies the alignment
hspace none specifies the horizontal space around the image when specifying the alignment
vspace none specifies the vertical space around the image when specifying the alignment
alt none specifies the alternative text of the image
border none specifies the width of the border drawn around the image
usemap none specifies the client-side clickable map
ismap none specifies the server-side clickable map

Support

HTML 2, HTML 3.2, HTML 4.01 [STF], XHTML 1.0 [STF], XHTML 1.1, XHTML Basic
Microsoft (MSDN)
[IE3 or later][Firefox 1 or later][Safari 1 or later][Opera 3 or later][Netscape 2 or later]

Explanation

The img tag specifies an image. Many browsers can display images of file formats (JPEG and GIF), while old browsers may not display ones of PNG file format. An alpha channel might not be reflected especially in PNG file format with alpha channel.
In XHTML, describe like <img src="URL" />.

Related Tags

area, map

Sample Code [Output]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=shift_jis">
<title>Sample</title>
</head>
<body>
<h1>Sample</h1>
<img src="photo.jpg">
</body>
</html>

Reference

Stopping wrap