HTML image tag
Sunday, September 16th, 2007 | Programming, Tech
Images can be embedded in a page using only one tag. There are examples of images on this page – the top header secton contains three images.
The basic syntax is as follows.
<img src="location.gif" width="300" height="100" border="0" alt="Description text">
For a basic image tag all you need is <img src=”location.gif” alt=”description”>. If you do this the image will display at its normal size although it is always a good idea to add a width and height tag.
The alt property defines the text that is displayed when the image is missing, it is displayed where the image should be. An example is shown below.
<img src="fakelocation.gif" width="200" height="100" alt="Here is an example">
Would produce:
Here is an example
To add a link round an image simply do it like a normal hyperlink
<a href="targetpage.html"><img src="location.gif" border="0></a>
Images can be embedded in a page using only one tag. There are examples of images on this page – the top header secton contains three images.
The basic syntax is as follows.
<img src="location.gif" width="300" height="100" border="0" alt="Description text">
For a basic image tag all you need is <img src=”location.gif” alt=”description”>. If you do this the image will display at its normal size although it is always a good idea to add a width and height tag.
The alt property defines the text that is displayed when the image is missing, it is displayed where the image should be. An example is shown below.
<img src="fakelocation.gif" width="200" height="100" alt="Here is an example">
Would produce:
Here is an example
To add a link round an image simply do it like a normal hyperlink
<a href="targetpage.html"><img src="location.gif" border="0></a>