Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 39 - 2606_PlugGPT_C7_Flipbook
P. 39

    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 nationa1 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>

                     </HTML>

                                                                                       Images, Links and Forms in HTML5  37

| 34 35 36 37 38 39 40 41 42 43 44 |