Share
HTML The <img> Tag and the Src Attribute
In HTML, images are defined with the <img> tag.
The <img> tag is empty, which means that it contains attributes only, and has no closing tag.
To display an image on a page, you need to use the src attribute. Src stands for "source". The value of the src attribute is the URL of the image you want to display.
Syntax for defining an image:
<img src="url" alt="some_text" />
The URL points to the location where the image is stored. An image named "boat.gif", located in the "images" directory on "www.leakbali.com" has the URL: http://www.leakbali.com/images/tutor/kuta.jpg.
The browser displays the image where the <img> tag occurs in the document.