Chapter :- 3 Handling Images in HTML

Summary

1. Images are added to a web page using the <img> tag in HTML.
2. The src attribute provides information about location of the image. The location here refers to the source of the image.
3. The image file specified should have a proper image format such as bmp, gif, tiff or jpg.
4. The alt attribute:- The alt attribute along with an image tag describes the source image. The example of the alt attribute is as follows: <img src=”rainbow.bmp” alt=”This is a rainbow”>
5. The height and width attributes :- The height and width attributes specify the values of height and width of the image in pixels as illustrated below. <img src=”rainbow.bmp” alt=”This is a rainbow” height=”120″ width=”180″>
6.The align attribute:- The align attribute is used to align the given image within the page or any element that contains the image. Example for the same is as follows. <img src=”chocolate.png” alt=”This is a rainbow” align=”right”>
7. Value Purpose
(a) Top :- The image is aligned at the top of the current line of text.
(b)Middle:- The image is aligned in such a way that the middle of the image appears at the current text.
(c)Bottom :- The bottomof the image is aligned with the baseline of the current line of text.
(d)Left :- The image is aligned to the left side of the containing window or element.
(e)Right :- The image is aligned to the right side of the containing window or element.
8. The border attribute :- An image on a web page can be highlighted with a border. The border attribute was created to specify the width of the border in pixels:<img src=”chocolate.png” alt=”This is a rainbow” align=”right” border =”20″>
9.The id attribute :- With the help of the id attribute, you can specify an identifier (name) for the image.
<img src=”chocolate.png” id=”choc_image”>
10.Adding space around image :- To add space around an image vspace and hspace attributes are used. To add space over and under the image the vspace attribute is used. <img src=”rainbow.bmp” hspace=”30″ vspace=”10″>
11.Linking Multimedia Files :- A video as well as an audio file can be integrated into an HTML document using an anchor tag.

 

Choose the correct option from the following:

(1) Which of the following tag is used to insert a video file into an HTML document ?

(a) img                                                                               (b) image
(c) href                                                                               (d) ime

(2) As the image element does not cause a line break, it is also referred to as which of the following ?

(a) An online image                                                         (b) An inline image
(c) An outline image                                                        (d) Blank image

(3) Which one of the following is a valid image file format ?

(a) Img                                                                                (b) Move
(c) Mp3                                                                               (d) Png

(4) Which of the following is provided when we use alt attribute of an image ?
(a) Alternative description                                               (b) Alt key definition
(c) Alternative image                                                         (d) Alternative HTML link

(5) Which of the following attributes specify the values of height and width of the image in pixels ? 

(a) Img src                                                                          (b) Height and width
(c) H and V                                                                           (d) Any of the above

(6) Which of the following is not a valid image format ?

(a) Imv                                                                                   (b) Png
(c) Bmp                                                                                  (d) Gif

(7) Which of the following concept is used to display whole image as a link ?

(a) Image as hot spot                                                          (b) Hot text
(c) Active link                                                                        (d) Any of this

(8) Which of the following are the two types of image maps ?

(a) Shopper side and user side                                          (b) Server side and client side
(c) Vendor side and supplier side                                      (d) All of these

(9) Which of the following tag is used to add an image map ?

(a) Image name                                                                     (b) Htemp
(c) Map                                                                                    (d) Alt