HTML Image

HTML Image

  • The tag is used to insert image in web page.
  • It is an empty tag, means it does not have end tag.
Syntax:
<img src="url" alt="some_text">

Example:
<img src="http://www.careerride.com/images/new/logo.png" width="200" height="100" alt="CareerRide Info" align="left">

Attributes of <img> tag

AttributesDescription
vspaceSpecifies the amount of space to the top and bottom of the image.
hspaceSpecifies the amount of space to the left and right of the image.
altSpecifies alternate text for an image when image is not found.
srcIndicate the source file.
borderSpecifies the thickness of border.
width and heightSpecifies width and height of the image.
alignUse to set horizontal alignment of the image. (left, right)
valignUsed to set vertical alignment of the image. (top, bottom)

Example: Image <img> tag

<!DOCTYPE html>
<html>
     <head>
          <title>HTML Image Example</title>
     </head>
     <body>
          <img src="http://www.careerride.com/images/new/logo.png" width="200" height="22" alt="CareerRide Info" align="right">
     </body>
</html>


Output
image tag