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>
<html>
<head>
<title>Learn HTML images by aryatechno</title>
</head>
<body>
<table>
<tr>
<td>
<h2>Set src="" border="" width="" height="" alt="" align="" style="" class="" attributes to <img /> tag </h2>
<p><img src="https://www.aryatechno.com/all/img/logo.png" border="0" width="100" height="50" alt="Learn HTML tutoial" align="left" style="" class="imgarya" />
</p>
</td>
</tr>
</table>
</body>
</html>

Output :

Comments

Leave a Reply

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

60700