Introduction to HTML : Adding images

Adding images

As the saying goes , "a picture is worth a thousand words". 

Images are embedded in HTML pages to illustrate concepts in a more concise and interesting manner. To put an image in a webpage, an <img> element is required. An <img> tag requires a src attribute which indicates the path of the image to be embedded in the page. The src attribute may be a file system path or a uniform resource locator (URL).


<img src="" >




Note that an <img> element has no end tag and content. 

The alt attribute

The alt attribute is a description of the image. This description is displayed when the image cannot be rendered.

<img src="" alt="This image is the logo of" >

In case the logo cannot be displayed, the alt text is displayed in place of the image.

The width and height attributes

The size of the image can be specified via the width and height attributes.


<img src="" width="40%" height="40%" > 




course logo
Introduction to HTML
Number of sections:
Content length:
Delivery formats: