Images In HTML


Images in HTML can be inserted using <img> tag. Each image to be inserted must be present on the server. The url of image on server is added to <img src=”IMAGE_URL”> to fetch the image

 

The alt tag defines a text which is displayed to users in case of poor network connectivity. Since there are cases that image could not be fetched on client side, so a text is displayed at the image position

Image height and width can be adjusted as given in code.


<!DOCTYPE html>
<html>
<body>


<p>This is a Hyperlink from image <a href="https://www.ourcoaching.com" target="_blank">
<img src="https://www.ourcoaching.com/images/ourcoaching-bg.png" width="100px" height="100px" alt="ourcoaching.com logo"></a></p>



<p>This a large image
<img src="https://www.ourcoaching.com/images/ourcoaching-bg.png" width="200px" height="200px" alt="ourcoaching.com logo"></p>

<p>This a image with style parameters
<img src="https://www.ourcoaching.com/images/ourcoaching-bg.png" style="width:200px;height:200px;" alt="ourcoaching.com logo"></p>

</body>
</html>


output is as follows





Related Tutorials