Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 94 - 2607_Trackpad_Pro_5.1_flipbook_C5
P. 94

    THE <IMG> TAG

                      The <img> tag allows you to add images to your webpage. It has the following attributes:

                              Attribute                                     Description

                                 src             Specifies the path of the image.

                                  alt            Provides alternative text if the image fails to load.

                                width            Specifies the width of the image.

                                height           Specifies the height of the image.

                      For example:

                      <!DOCTYPE HTML>
                      <HTML>
                      <HEAD>
                      <TITLE> Adding an Image </TITLE>

                      </HEAD>
                      <BODY>

                      <H1> Planting a Tree </H1>
                      <img src="tree.jpg" alt="Planting a tree" height="300" width="300">
                      </BODY>

                      </HTML>

                      Ensure that the tree.jpg and the webpage must be saved at the same location to see
                      the output of the above webpage. If not so, give the complete path of the image in the

                      src attribute.

                       92   Premium Edition-V

| 89 90 91 92 93 94 95 96 97 98 99 |