Image

HTML & CSS - HTML IMAGE - HTML IMAGE

HTML IMAGE

HTML <img> tag is used to display image on the web page. HTML <img> tag is an empty tag that contains attributes only, closing tags are not used in HTML image element.

The <IMG> tag is used to incorporate in-line graphics (typically icons or small graphics) into an HTML document. In HTML, images are defined with the <img> tag.

EX:
  <img src="url" alt="some_text">
<!DOCTYPE html>
<html>
<body>
<p>If a browser cannot find an image, it will display the alternate text:</p>
<img src="help4code.jpg" alt="Tutorial site" style="width:120px;height:120px;">
</body>
</html>

The alt attribute provides alternative information for an image if a user for some reason cannot view it. src It is a necessary attribute that describes the source or path of the image. It instructs the browser where to look for the image on the server. The location of image may be on the same directory or another server.