Page 63 - TP_Prime_V2.2_Class8
P. 63

•  Width: It specifies the width of the image on the web page. For example,

                   <IMG SRC="lily.jpg" WIDTH="50%">
                 •  Height: It specifies the height of the image on the web page. For example,

                   <IMG SRC="lily.jpg" HEIGHT="60%">
                 •   Alt: It specifies the alternate text to be displayed in the web browser, if the provided
                    image is not found. For example,

                   <IMG SRC="lily.jpg" ALT="Describing the flower">
                 Let us use the <IMG> tag to insert an image on the web page in the following way:

                 <!DOCTYPE html>                                                                                            MORE ON HTML
                 <html>

                 <head>
                     <title>Inserting Image</title>
                 </head>
                 <body>                                                                                                   61

                     <b>Inserting image on the web
                 page</b>
                     <img src="lily.jpg" width="200"
                 height="200" style="float: right;
                 border: 2px solid black;">
                 </body>
                 </html>

                                                                              Image Inserted with Border
                 Make sure to save the image you want to insert on the web page in the same location as your
                 HTML file. If we want to insert an image from any other location, we need to provide the
                 complete path of the image to the SRC attribute. For example, if our image is saved in the
                 D: drive of computer, then the path of the image will be D:\lily.jpg.

                                       Some of the image formats supported by HTML are Joint Photographic
                         Fun           Experts Group (JPEG), Graphics Interchange Format (GIF) and Portable
                         Fact!
                                       Network Graphics (PNG).



                  Linking Web Pages


                 A website is a collection of web pages that are interlinked with each other and contain
                 related information. These web pages are linked with the help of a feature of HTML called

                 a hyperlink. A hyperlink is generally an underlined text that takes the user to another web
                 page when clicked.  Generally, hyperlinks are seen in blue colour. Images can also be used
                 as hyperlinks. When the mouse is hovered over a hyperlink, the mouse pointer changes to a

                 hand shape. When a hyperlink is clicked, its colour changes to purple.
   58   59   60   61   62   63   64   65   66   67   68