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 |
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" />.
<!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>