Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 49 - CoreGPT(Podar)_Flipbook_C8
P. 49

    INSERTING IMAGES

                     Images and other graphical elements such as drawings, paintings and charts enhance the look
                     and feel of a web page. All these graphical elements are considered as image in the web page.
                     HTML also allows us to insert images inside the web pages through the <IMG> tag. The <IMG>
                     tag is a container tag and has various attributes.

                     The attributes of the <IMG> tag are:
                        SRC: It specifies the source or URL of the image that has to be inserted in the web page. For
                         example,

                         <IMG SRC="lily.jpg">
                        WIDTH: It specifies the width of the image in the web page. For example,

                         <IMG SRC="lily.jpg" WIDTH="50%">
                        HEIGHT: It specifies the height of the image in the web page. For example,

                         <IMG SRC="lily.jpg" HEIGHT="60%">
                        ALIGN: It aligns the image with respect to the text placed adjacent to the image. Image can
                         be aligned left, right, middle, bottom and top. For example,

                         <IMG SRC="lily.jpg" ALIGN="right">
                        BORDER: It specifies the thickness of the border surrounding the image.

                         <IMG SRC="lily.jpg" BORDER="2">
                        ALT: It specifies the alternate text to be displayed in the web browser, if the provided image
                         is not found. For example,

                         <IMG SRC="lily.jpg" ALT="Describing the flower">
                     Let us use the <IMG> tag to insert an image on the web page in the following way:

                     <HTML>
                     <HEAD> <TITLE> Inserting Image </TITLE>

                     </HEAD>
                     <BODY>
                     <B> Inserting image on the web page </B>

                     <IMG SRC="lily.jpg"
                     WIDTH="200"

                     HEIGHT="200"
                     ALIGN="right"
                     BORDER="2">

                     </BODY>
                     </HTML>                                                            Image inserted with border

                                                                   Working with Lists, Images and Tables in HTML         47

| 44 45 46 47 48 49 50 51 52 53 54 |