HTML Image

HTML Image <img> tag is used to display images on web pages.

Syntax :
<img src="" border="" width="" height=""  />

HTML Image <img> tag attribute

  1. src : It specifies the path (URL) to the image. The location of image may be on the same directory or another server.
  2. border : It specifies border of image.
  3. width : It specifies the width of an image. You Can also apply CSS in place of width attribute.
  4. height : It specifies the height of an image. You Can also apply CSS in place of height attribute.
  5. alt : It defines an alternate text for the image. The alt attribute is used for SEO purpose.
  6. align : It specifies left, right, top, bottom, middle alignment.
  7. style : You can apply style property to image like font, border, color, background, text alignment, margin, padding etc using style attribute.
  8. class : You can define class name to apply style on image.

Example :

<!DOCTYPE html>
<title>Learn HTML images by aryatechno</title>
<h2>Set src="" border="" width="" height="" alt="" align="" style="" class="" attributes to <img /> tag </h2>
<p><img src="" border="0" width="100" height="50" alt="Learn HTML tutoial" align="left" style="" class="imgarya" />

Output :


Leave a Reply

Your email address will not be published. Required fields are marked *