Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 61 - 2607_Trackpad_Pro_5.1_flipbook_C7
P. 61

    IMAGES IN HTML

                      Images  enhance the look  of a web page  and make  it  attractive.  These are used  to  convey
                      information and catch the attention of website visitors. The most widely used image formats
                      supported by HTML are GIF, JPEG and PNG. The images on a web page can be inserted using the
                      <IMG> tag, which is an empty tag. It has the following attributes:

                           Attribute                     Value                          Description

                                              URL (or location) of the       SRC  stands  for source.  It  specifies  the
                       SRC
                                              image                          location of the image.
                                                                             ALT stands  for alternate  text.  It  specifies

                       ALT                    Text                           which alternative text should be displayed
                                                                             if selected image is not displayed.

                      Except for SRC attribute, all other attributes are optional in the <IMG> tag.

                      Syntax of <IMG> tag:
                      <IMG SRC=“URL of the image” ALT=“alternate text” WIDTH=“500” HEIGHT=“600”>

                      ALT = “Alternate Text”

                      WIDTH = “Value of width in pixels”

                      HEIGHT = “Value of height in pixels”
                      Write HTML code for inserting an image on a web page.

                      <!DOCTYPE HTML>
                      <HTML>

                      <HEAD>
                      <TITLE> Inserting Images </TITLE>

                      </HEAD>
                      <BODY>

                      <H1 STYLE = "text-align:center"> Valley of Flowers </H1>

                      <IMG SRC = "D:\Valley_of_Flower.jpg">
                      <P> Valley of Flowers National Park is an Indian national park, located
                      in North Chamoli and Pithoragarh, in the state of Uttarakhand and is
                      known for its meadows of endemic alpine flowers and the variety of flora.
                      </P>

                      </BODY>

                       60   Premium Edition-VII

| 56 57 58 59 60 61 62 63 64 65 66 |