Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2006
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    creating an empty div

    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?

  • #2
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,785
    Thanks
    8
    Thanked 131 Times in 129 Posts
    give the div a height as well.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •