View Full Version : creating an empty div

10-23-2006, 11:52 PM
I am trying to create an empty div as a placeholder. Say, if an image fails to load, then this div would still leave an empty space.

The way I think to do it is to embed the img inside the empty div.



<div class=placeholder><img src></div>

The problem with this is that the empty div shrinks when there is nothing inside. What do you guys suggest?

10-24-2006, 12:30 AM
give the div a height as well.