HTML Image

<img> tag is used to add images in html page

let's add an image to this web page :

Syntax:



  <img src="img/car.jpg" height="180" width="300" alt="car image">

Output:


car image

We used some attributes with <img> tag.

  • src
  • alt
  • height
  • width

<img> attribute


src :
- Attribute used to specify the path/source of the image.
you can also use URL as source.
alt :
- Attribute used to specify the text to show when the browser can't load the image.
height :
- Attribute used to specify the height of the image.
width :
- Attribute used to specify the width of the image.