Images in HTML

In HTML  img  element tells the browser, “Place an image here.” It is totally up to that you can place an image element right in the flow of the text at the point where you want the image to appear, as in the following example. Images stay in the flow of text and do not cause any line breaks

Syntax to show image

<img src="img/bg-img/gallery1.jpg  alt="html-images"  /> 

<img src="img/bg-img/gallery2.jpg  alt="html-images"  /> 

<img src="img/bg-img/gallery3.jpg  alt="html-images"  /> 

Images are shown below.

html_images
html_images
html_images

The src and alt attribute

As in above example there were two attribute used "src" and "alt". src attribute is used to fretch the url of image to locate the image when we put it in between the "img" tag. While "alt" attribute is stands for alternate.If some time our image is not display due to some reasons like slow network or heavy image etc.Then it creates problem for the to understand about that.Heres come the solution called attribute which is displayed at the place of image. It also has great importance in you seo score.So do't forget to use alt attribute.


The link through image

<a href="html-14.php"><img src="img/core-img/favicon.ico" alt="favicon"> < /a>
Click on this image. favicon

Explanation of image linking

To make an image a link, simply put the img element in the anchor element. Sometime on some social sites or anywhere you see some logo,when you click on that they redirect you to some targeted post.Actually they are link on the back of image.They are very important and very used in html.








The Best

Comment here

If you have any query, if you want to know something about any of technical course related to computer science field, if you have any suggestion about relevant to uploaded content or if you anything wrong here (any mistake in content) than please contact us. Keep in mind, comment should be according to community guidelines.