Beruflich Dokumente
Kultur Dokumente
One of the fascinating feature of HTML/XHTML is their ability to insert images in your
document. The images can make your document look attractive, informative and
professional. However images must not be used in access because that can make your
document cluttered, confusing and inaccessible. You can place all types of images in
your document, from logos to photographs. The image can be placed in your document
by embedding <img> tag in your document's source. Now let us demonstrate the images
with code below :
<html>
<head>
<title>Images</title>
</head>
<body>
<h1>Sweet child</h1>
<img src="download.jpg" />
</body>
</html>
You can specify the image's dimensions including width and height attribute and then set
them equal to pixel dimensions of the image as :
<html>
<head>
<title>Images with fixed dimensions</title>
</head>
<body>
<h1>Sweet child</h1>
<img src="download.jpg" width="200" height="200" />
</body>
</html>
You can also specify the text to be displayed in place of images for the users with non-
visual browsers by including alt attribute. Let us see :
<html>
<head>
<title>Images with text for non-visual browsers</title>
</head>
A border can also be placed around the image by using border attribute and setting it
equal to the border's thickness in pixels. Let us see it :
<html>
<head>
<title>Images with border around</title>
</head>
<body>
<h1>Sweet child</h1>
<img src="download.jpg" width="200" height="200" alt="These are sweet
babies" border="5" />
</body>
</html>
</body>
<html>
<head>
<title>Images</title>
</head>
<body>
<h1>Sweet child</h1>
</body>
</html>
The following table describes the attributes that is supported by <img> tag :
Attribute align,alt,border,class,controls,dir,
dynsrc,height,hspace,id,ismap,lang,
longdesc,loop,lowsrc,name,
onAbort,onClick,onDblClick,onError,
onKeyDown,onKeyPress,onKeyUp,onLoad,
onMouseDown,onMouseMove,onMouseOut,
onMouseOver,onMouseUp,src,start,style
, title,usemap,vspace,width.