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.
<img src="url" alt="some_text">

<img src="" width="200" height="100" alt="CareerRide Info" align="left">

Attributes of <img> tag

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>
          <title>HTML Image Example</title>
          <img src="" width="200" height="22" alt="CareerRide Info" align="right">

image tag