Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 38 - 2609_Logiccode
P. 38

    ATTRIBUTES OF THE <IMG> TAG
                      The following table summarises the attributes of the <IMG> tag:

                            Attribute                  Value                              Description
                              Name

                                                                        The SRC attribute specifies the location or URL

                                                                        of the image to be embedded. You can simply
                                                                        write the name of the file with its extension
                       SRC                     URL or file path
                                                                        in the SRC value if the image is saved in the
                                                                        same folder as the HTML file. All <IMG> tags
                                                                        must include the SRC attribute.

                                                                        It provides alternative text for the image,
                                                                        which describes the image. If the image URL
                                               Text description of
                       ALT                                              is incorrect or image is not present in defined
                                               image
                                                                        folder, the user will see the alternative text in

                                                                        place of the image.

                      Syntax:

                      <IMG SRC="Name or path of the image file" ALT="TEXT">
                      If  the image file is in the same  folder, mention the name of the image  with its  extension.
                      For example:

                      <IMG SRC="beautiful-flamingos-lake.jpg" ALT="Flamingo Image">
                      If the image file beautiful-flamingos-lake.jpg is in a different folder than the HTML file, you need
                      to mention the complete path of the image file.
                      <IMG SRC="D:\beautiful-flamingos-lake.jpg" ALT="Flamingo Image">
                      Code 5.  Write the HTML code to present the given web page using the <IMG> tag to display an
                               image.

                      <!DOCTYPE HTML>
                      <HTML>

                      <HEAD>
                      <TITLE>Flamingo Facts</TITLE>

                      </HEAD>
                      <BODY STYLE="BACKGROUND-COLOR: #F0F8FF;">

                      <H1 STYLE="COLOR: #FF6347;
                      TEXT-ALIGN: CENTER;"> All About Flamingos</H1>

                      <H2 STYLE="COLOR: #4682B4;

                       36   Premium Edition-VII

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