imgsrc: HTML Image tag, alt src width height attributes

Including an image in html requires use of <img> tag. To display an image we have to give image path in src attribute image path can be path of image storage in local system or it can be a url.

HTML Image tag Syntax

img tag uses following few attributes

  1. src: This attribute is compulsory it provide path to image(including image name with extension). path may be either url or path of image in directory if image is in same directory where your htlm page is then you have to give image name with extension only.
  2. alt: It provides alter native text for image. If image is not loaded then browser will display this text message.
  3. width: We can set the width of image either in pixel value or % wise.
  4. height: We can set the height of image either in pixel value or % wise.

HTML Imgsrc alt widht and height attributes

HTML Image Example

HTML imgsrc url example with alt attribute

HTML imgsrc url example with alt width and heigh attribute

Output:

Image

Image

Image

Here we discussed Image with imgsrc alt  width and height attribues.

Q img src not working

A. It may be due to image path is not correct. copy your image path and paste in browser if image opens then ok other wise check your image path again.

Read More

  1. HTML table tag

Reference

  1. <img>: The Image Embed element