Page 64 - Trackpad_V5_Book 7
P. 64

IMAGES IN HTML

            Images enhance the look of a web page and make it attractive. These are used for conveying

            information and catching 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”

            ALIGN = “Alignment Type”

            Write HTML code for inserting an image on a web page.

            <!DOCTYPE HTML>
            <HTML>
            <HEAD>
            <TITLE> Inserting Images </TITLE>
            </HEAD>

            <BODY>
            <H1 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>


             62   Pro (Ver. 5.0)-VII
   59   60   61   62   63   64   65   66   67   68   69