...

View Full Version : creating an empty div



lli2k5
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.

.placeholder{
width:50px;

}

<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?

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum