IE make a div with no content not fill up width

Discussion in 'CSS' started by rupurt, Jul 13, 2006.

  1. #1
    if you didnt understand the subject i'll try and explain it a bit better here!

    This is my problem in IE my page looks like this
    http://www.readyflowers.com.au/div-fill.gif

    But what i want is when there is no content for those divs not to appear so it would look like this (In firefox it works!)

    http://www.readyflowers.com.au/div-fill-firefox.gif
     
    rupurt, Jul 13, 2006 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    I noticed you also posted the same question at Devshed. It's not polite to cross post. Find the forum you feel will best handle your issue and give them a chance to answer.

    If you don't want to appear to be a luser, read and follow the suggestions in ESR's How to ask questions the smart way.

    cheers,

    gary
     
    kk5st, Jul 13, 2006 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    IE preserves a linebox which has a line-height determined by the font size. Modern browsers treat an empty block element as, well, empty, therefore zero height.

    It's a bug in IE. The first fix is don't have empty block elements. Short of that, make the font-size zero, and overflow hidden.

    cheers,

    gary
     
    kk5st, Jul 13, 2006 IP