Language References
Embeds an image or a video clip in the document. | HTML 2, 3.2, 4, 4.01, 5 |
HTML Syntax
<img
align = absbottom | absmiddle | baseline | bottom | left | middle | right | texttop | top
alt = text
border = n
class = classname
datafld = colname
datasrc = #id
dynsrc = url
height = n
hspace = n
id = value
ismap
loop = n
lowsrc = url
name = name
src = url
style = css properties
title = text
usemap = url
vspace = n
width = n
event = script
>
The IMG element is used to render images on a page. The IMG src attribute indicates the source file of the image to display.
An image can be embedded within an A ( anchor ) element, which links the image to a target destination.
The lowsrc attribute lets authors optionally specify a lower resolution image with a smaller file size, to provide an image that loads more quickly than the source image. The lowsrc image displays first, while the real image loads.
The height and width attributes indicate the size of the image, and must always be specified. Browsers use these dimensions to fix the position of the image on the page, and continue to load text and other elements without having to wait for the image to load.
The usemap attribute allows an image to be set as an image map, with multiple clickable areas that each link to different URLS.
The current standard types of image formats applicable for the Web are:
- GIF ( Graphics Interchange Format )
- JPEG ( Joint Photographic Experts Group )
- PNG ( Portable Network Graphics )
IMG Members
<center>
<img src="imgs/sample.gif" width=200 height=200 border=0 alt="Somewhere on Earth">
</center>
AREA INPUT type=image MAP