12-HTML Images


This tutorial is all about 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=”http://itsourcecode.com/”>
<img src=”http://itsourcecode.com/wp-content/uploads/2015/10/cropped-ITSourceCodeLogo1-300×300.png” alt=”ITSourceCodeLogo.png” width=”300″ height=”300″ style=”width:100px;height:100px;” />








Readers might read also:


Facebook Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.