HTML Tutorial | Image

In HTML, <img> tag is used to present images (like jpg, png, gif etc.) on web page.

  • <img> tag is an example of One sided tag
  • Syntax: <img src="url">
  • src stands for Source.
  • url stands for Uniform Resource Locator (where our resource is located).
   <img src=""> 

Alt attribute

The alt attribute specifies an alternate text for an image, if the image cannot be displayed.

  • The alt attribute provides alternative information for an image if a user for some reason cannot view it (because of slow connection, an error in the src attribute, or if the user (or blind person) uses a screen reader).
  • If a browser cannot find an image, it will display the alt text.
   <img src="" alt="pooripadhai logo"> 

Width and Height attribute

The width and height attribute used to re-size an image.

   <img src="" alt="pooripadhai logo" width="60px" height="50px"> 
   <img src="" alt="pooripadhai logo" width="20%" height="15%"> 

Best Use:360p or more (480p or 720p)

Best Use:360p or more (480p or 720p)