David19801 David19801 - 9 months ago 57
HTML Question

HTML if image is not found

I have an image in a HTML page:

If the image is not found on the server it shows an ugly blank square.

I want to make it so that if an image is not found it will display nothing or some other default image that I know is definitely on the server.

How can this be done?


Solution - I removed the height and width elements of the img and then the alt text worked.

<img src="smiley.gif" alt="Smiley face" width="32" height="32" />


<img src="smiley.gif" alt="Smiley face" />

Thank you all.