Images and Icons for web sites.
Using images in HTML is easy.
To add an image to an HTML document use the <img> tag. The image tag or element does not require a closing tag. We use the attribute "src" to map the image location to the image object.
Example:
< html>
< head>
< title>HTLM Image element</title>
</ head>
< body>
< img src="images/stuck.gif">
</ body>
</ html>
Images can be used within other HTML elements such as Anchors.
The images tag has a very important attribute. The attribute is called "alt". The "alt" attribute is a place holder for text in the event that the users browser does not support the image element. You must always make it a habit to complete this field since search engine robots use this field for information. If your browser supports images (which most do) the image is rendered and not the "alt" value.
Example:
< html>
< head>
< title>HTLM Image with Alt attribute</title>
</ head>
< body>
< img src="images/stuck.gif" alt="He can't come to the phone right now.">
</ body>
</ html>
With the above example we assigned the "alt" value. Now depending what browser you are using, the browser might display the tooltip value with the alt value. If you want to provide a different tooltip value you must assign a value to the "title" attribute.
Example:
< html>
< head>
< title>HTLM Image with Alt and title attribute</title>
</ head>
< body>
< img src="images/stuck.gif" alt="He can't come to the phone right now." title="Busy">
</ body>
</ html>
Do a few examples yourself.
|