More about HTML | Images in HTML

 Images in HTML


Images are used to improve the appearance of a web page. To add an image in HTML we have to use the <img> tag.

<img> tag has two required attributes.

  • src attribute -  gives the location of the image.
  • alt text attribute - specify an alternate text for the image if the image is not displayed on the browser.

We can add an image to our website as shown in the following example.


We can resize an image by specifying its width and height. To do that we have to use the width and height attributes of the <img> tag.

We can resize an image using the width and height attributes as shown in the following example.



Post a Comment

Previous Post Next Post