Explanation
(skip)
Examples 1 and 2:
The alt attribute provides a brief description of the image.
<img src="smile.gif" alt="smile" />
<img src="flag.gif" alt="Olympic Flag" />Example 3:
The alt attribute holds an asterisk * in case our image bullet.gif • does not appear. It could hold a hash-mark # or anything similar.
<img src="bullet.gif" alt="*" />
Example 4:
The alt attribute holds the numeric character reference for a right-arrow → → in case our image arrow.gif
does not appear.<img src="arrow.gif" alt="→" />
Example 5:
Sometimes we may not want to include a verbal alternative for an image. We must still include the alt attribute to make our web-page valid, but we can leave the value of the attribute blank.
<img src="spaceHolder.gif" alt=" " />
