Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Why does IE6 do this??

  • 05-12-2005 10:08PM
    #1
    Closed Accounts Posts: 1,422 ✭✭✭


    Can somebody please tell me - is this a bug in IE6?

    http://www.siliconweb.ie/height/css_height.html

    A quick look at the source will reveal the blue div should only be 1px high. This works fine in FF. Is it a known bug in IE? The minimum height it will seem to display a div like this seems to be about 18px...

    Anybody got a workaround??

    Source (could hardly be simpler - if IE can't do this right, can it be trusted to do anything??):

    <html>
    <head>
    <title>test</title>
    <style type="text/css">
    #deco_bar {width: 100%; height: 1px; background: #000066;}
    </style>
    </head>

    <body>

    <div id="deco_bar"> </div>

    </body>
    </html>


Comments

  • Registered Users, Registered Users 2 Posts: 999 ✭✭✭cregser


    Just for the heck of it. Try using class="deco_bar" instead of id="".


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    That won't work. The problem is because IE is rendering the space character at the full default font height. To fix it, set the font-size to 1px.


  • Registered Users, Registered Users 2 Posts: 999 ✭✭✭cregser


    Ah Aidan, you're too fast :)

    #deco_bar {width: 100%; height: 1px; background: #000066; font-size: 1px;}


  • Closed Accounts Posts: 1,422 ✭✭✭rockbeer


    To fix it, set the font-size to 1px.

    Nice idea, thanks. It helped a bit... reduced it to about 14 px high :rolleyes:

    [edit]Oh... and it's the same with or without the space character. An empty div behaves just the same.[/edit]


  • Registered Users, Registered Users 2 Posts: 8,488 ✭✭✭Goodshape


    It's line-height you need to set, not font-size.

    [html]
    <style type="text/css">
    #deco_bar {width: 100%; line-height : 1px; height: 1px; background: #000066;}
    </style>
    [/html]


  • Advertisement
  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    Goodshape wrote:
    It's line-height you need to set, not font-size.

    [html]
    <style type="text/css">
    #deco_bar {width: 100%; line-height : 1px; height: 1px; background: #000066;}
    </style>
    [/html]
    D'oh...


  • Closed Accounts Posts: 1,422 ✭✭✭rockbeer


    Goodshape wrote:
    It's line-height you need to set, not font-size.

    That's sorted it. Nice one, thanks.

    Bruce


Advertisement