An image coded as below::
The <img> tag embeds an image in an HTML page.
Note: images are not technically inserted into an HTML page, images are linked to HTML pages. The <img> tag creates a holding space for the referenced image.
The <img> tag has two required attributes: src and alt.
The <img> tag is supported in all major browsers.
In HTML the <img> tag has no end tag.
In XHTML the <img> tag must be properly closed.
Hint: The alt attribute is meant to be used as an alternative text if the image is not available, not as a mouse-over text. To show a mouse-over text on images or image-maps, use the title attribute, like this: <img src="../../images/image9.png" alt="Its An Image" title="Its An Image" />
Note: When a web page is loaded, it is the browser, at that moment, that actually gets the image from a web server and inserts it into the page. Therefore, make sure that the images actually stay in the same spot in relation to the web page, otherwise your visitors will get a broken link icon. The broken link icon is shown if the browser cannot find the image.
DTD indicates in which HTML 4.01/XHTML 1.0 DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
The <img> tag supports the following standard attributes:
More information about Standard Attributes.
The <img> tag supports the following event attributes:
More information about Event Attributes.
aligning imagesHow to align an image within a text.
Let the image floatHow to let an image float to the left or right of a text.
How to add a hyperlink to an image.
Create an image mapHow to create an image map, with clickable regions. Each region is a hyperlink.
Your Query was successfully sent!