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.

simple div line, weird in IE6

  • 05-03-2009 02:47PM
    #1
    Registered Users, Registered Users 2 Posts: 8,070 ✭✭✭


    <div style="border: none; background-color: #000000; height: 1px; z-index:20; "></div>


    how can i get the above to show as it does on IE 7 / FF?

    IE 6 shows it huge, why oh why?
    I dont want to use images


Comments

  • Closed Accounts Posts: 7,144 ✭✭✭DonkeyStyle \o/


    <div style="border: none; background-color: #000000; height: 1px; z-index:20; line-height: 0;"> </div>

    ^ should do it
    Or you could approach it some other way, like using border-bottom on the div or using a <hr>


  • Registered Users, Registered Users 2 Posts: 872 ✭✭✭grahamor


    font-size:1% should help if line-height doesnt solve it


  • Moderators, Society & Culture Moderators Posts: 25,617 Mod ✭✭✭✭Dades


    You might find the above reduces only to a 2px line in one or more browsers.

    I was dealing with this recently and had to add content to the DIV for it to reduce to 1px (I used a 'blank' comment).

    [HTML]<div style="background-color: red; height: 1px; font-size: 1px; line-height: 1px; padding: 0px"><!-- --></div>[/HTML]

    Also, in case the DIV is within a table cell make sure there is no cellspacing/cellpadding in the table/td.


Advertisement