tags:

views:

13

answers:

1

How can I force an empty frame of specified size in html if an image is not found ? for example, suppose I have an image i know to be 100x100, but the image is not found at the specified url. yet, I would still like to have an empty frame 100x100.

I tried setting <img src="whatever" width="100" height="100" />, as well as via css, but it does not work. if the image is not found, nothing is displayed.

+1  A: 

Add the css property display: inline-block to the image. If you need to support older browsers, then you need to use block instead of inline-block.

Marius