Logo
HTMLCSSJavaScriptReactjsnewContactUpdates

Get started today

HTMLCSSJavaScriptReactjsnewContactUpdates

Tools

Resume BuilderQR GeneratorVS Code Editor

Connect

GitHubWhatsApp Channel
paragraph tag
hyperlink

HTML Image Tag

By Saket Bhatnagar•July 5, 2025•Beginner to Intermediate

Table of Contents

  1. image tag
  2. Attributes of image tag
  3. Example

image tag

  1. 1<img> tag is used to attach or embed images to our webpage.
  2. 2It is non-container tag.
  3. 3It is inline level element.

Attributes of image tag

  1. 1src attribute - It is used to provide path or location of the image.(Syntax:- src='path')
  2. 2alt attribute -It is used to provide alternative content or text to the image and this alternative content will be displayed only when the image is not displayed due to any reason and we should write meaningful content within alt attribute.(Syntax:- alt='text')
  3. 3height attribute - It is used to set height of the image.(Syntax:- height='value')
  4. 4width attribute - It is used to set width of the image.(Syntax:- width='value')

Example

  1. 1<img src = 'path' alt='text' height='300px' width='500px'>
  2. 2Note:- Path should be relative(The path with respect to current directory is called as relative path)

Share this article

Last updated: August 5, 2025

Join Our Community

Login to Join

© 2025 Saket Bhatnagar. All rights reserved.