HTML Image Tag

HTML image tag is used to insert or apply image in your web page.
Syntax: <img src="url">

In order to apply image, img tag must have src attribute, src is the image URL or path. HTML img tag is an empty tag, so there is no need to close it.

HTML Image tag - Attributes
Src src specifies a source path for the image to be displayed on the webpage.
Specifies the height and width of the image.
Align* To change image alignment, possible values are: Left and Right.
Border* Specifies the thickness of a border to be drawn around the image.
Alt Alt attribute specifies the Alternate text that appears when the image is unable to display.
Title Title attribute is used to provide information in the form of tooltip.
Hspace* Specifies the margin space on the left and right side of an image
Vspace* Specifies the margin space on the top and bottom of an image.

Exercise 1: Image Gallery. Click on the image to open it on a full screen in a new tab window.