Page 115 - CA_165_V2.0_Flipbook
P. 115

MORE ABOUT HTML                                                     3








                 A web page should be designed in such a way that a user can identify or read the content easily.

                 The document of the web page can be formatted and made attractive with the help of different
                 tags of HTML and by including images, links, colours, etc. In this chapter, we will learn about tags
                 that help to format, insert and link the web pages.

                 Graphics, images, photographs, all these visual elements make a web page more attractive and
                 give unique look. These virtual elements enhance the presentation of the web page for its items
                 which allures and attracts the users to browse. Other than the text matter, HTML helps to display
                 static or animated images on the web pages. It accepts the image in file formats with extensions.
                 GIF (Graphics Interchange Format),. JPEG (Joint Photographic Experts Group) or .BMP (Bit Map)

                   <IMG> TAG

                 The <IMG> (Image) tag is an empty tag. The attribute SRC (Source) is used with the IMG tag to
                 specify the location and name of the image file. The <P> tag should be placed before the <IMG>
                 tag because the <IMG> tag does not form a new block element and would appear in the same
                 line unless we add <P> tag. A blank line appears before and after the image when the image
                 insention tag <IMG> is enclosed within <P> and </P> tags. Syntax to use the <IMG> tag is as follows:

                 <IMG SRC="Image file" ALIGN="Value"  BORDER="Value"  WIDTH="Value"
                 HEIGHT="Value" HSPACE="Value"   VSPACE="Value"   ALT="Text">
                 For example:

                 <P><IMG SRC= "FLOWER.GIF"></P>

                                                          <IMG> Tag
                     Type           Function            Attributes         Contains          Used Inside
                  Empty tag    Inserts an image into  SRC, ALT, WIDTH,  None             Typically placed
                               the document.         HEIGHT              (self-closing).  within <BODY> or
                                                                                         other container tags.

                         Notes

                         Images are sometimes referred to as inline images because these are inserted within a line of
                         body text in a web page with the help of <IMG> (Image) tag.


                 Attributes of <IMG> Tag
                 The following attributes are used with <IMG> tag:

                   SRC                ALIGN              BORDER            WIDTH
                   HEIGHT             HSPACE             VSPACE            ALT


                                                                                            More About HTML      113
   110   111   112   113   114   115   116   117   118   119   120