HTML allows static and animated images in an HTML page. It accepts two picture file formats .gif and .jpg . Image can be inserted into a web page using the tag <IMG>, along with the name of the image file (filename. Gif or file name.jpg or file.jpeg). The attributes of the tag <IMG> are:
Align: TOP: indicates the text after the image to be written at the top, next to the image.
Align= Middle: indicates the text after the image to be written at the middle, next to the image.
Align = center
Align= Right
Border: Specifies the size of the border of image.
Width: Specifies the width of the image.
Height: Specifies the width of the image.
Hspace: indicates the amount of space to the left and right of the screen.
Vspace: amount of the space to the top and bottom of the image.
Alt: Displays the text incase the browser each unable to display
the image specified in the SRC attribute.
Eg. <IMG width = 400 height = 50 Border= 0 Hspace=0 SRC
= “Image.gif” align = center>
Eg: Try this code
<HTML>
<head><title> …….</title></head>
<body>
<B> way for inserting image</B>
<center>
<I> Image without using attributes</I>
<Image SRC =”image1.gif”><BR>
<I>Image using attributes</I>
<Image border=3 height=200 width=200
SRC=’’image1/computer.gif’’>
</center>
</body>
</html>
Using ALT attributes
<Body>
<B>use of ALT attribute</B>
<center>Avaliable image : image1.gif
<Img src = “computer/image1.gif><br><br>
Unavailable image: image2.gif
<I> without alt attribute </I>
<br><br>
<I> with alt attribute </I>
<img src = “ computer/image2.gif alt = “image”><br>
</body>
</html>
No comments:
Post a Comment