We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

12-HTML Images

Images are defined with the  <img> tag in HTML. This  <img> tag is empty and does not have a closing tag, but it only contains attribute.


The src attribute is the one that specifies the URL (location) of an image


<img src=”url” alt=”name here” />


The alt attribute is the one that specifies an alternate text for an image, if it cannot be displayed. It also provides alternative text if the src attribute has an error due to slow connection.


name here


The style attribute is used to specify the width and height of an image.


<img src=”url” alt=”name here” style=”width:100px;height:100px;” />



or you can use this instead.


<img src=”url” alt=”name here” width=”100″ height=”100″ / >


To put a link into an image, simply place the tag inside the tag.


<a href=””>
<img src=”×300.png” alt=”ITSourceCodeLogo.png” width=”300″ height=”300″ style=”width:100px;height:100px;” />




Facebook Comments
(Visited 2 times, 1 visits today)
Share this

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked * © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!

%d bloggers like this: