Right aligning column table does not work in IE6

Discussion in 'HTML & Website Design' started by dohodoho, Feb 3, 2009.

  1. #1
    Hi, I have CSS/html code that right aligns a column which works for Firefox 3.0 but not for IE6 (see attached screenshots). Do you know what I need to change to have it work for IE6?

    ----- HTML ------
    <table><tr>
    <td style="width: 600px; vertical-align: top;">
    asdfasd fasdf asd fasdf asdf asdf asdf asdf asd fasdf asdf asd fasdf asdf asdf asdf asdf asdf asdf asdf asdf asd fasdf asdf asdf asdf asdf asdf asdf asdf asdf
    </td>
    <div class="rules" style="background-color: #f6f6f6; text-align: center; float:right;">
    <div class="inner" style="color: #3f3f3f; font-size: 12px;"><span class="corners-top"><span></span></span>
    asdf asdf asd <br />
    asdf asdf asd <br />
    asdf asdf asd <br />
    asdf asdf asd <br />
    asdf asdf asd <br />
    asdf asdf asd f
    <span class="corners-bottom"><span></span></span>
    </div>
    </div>
    </tr></table>

    ---- rules CSS ----
    div.rules {
    background-color: #ececec;
    color: #bcbcbc;
    padding: 0 10px;
    margin: 10px 0;
    font-size: 1.1em;
    }
     

    Attached Files:

    dohodoho, Feb 3, 2009 IP
  2. promotionalhelp

    promotionalhelp Peon

    Messages:
    411
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,

    It looks to me as though your coding is missing the sign for the div 'id' or 'class':

    div id = #rules {}
    div class = .rules{}

    Your padding and margins are not declared very well either. Try using 4 parametrers instead of 2:

    Padding: 0 0 0 0;
    margin: 0 0 0 0;

    (0 0 0 0 size order = top, right, bottom, left)


    You can do an IE6 fix by taking the same styles but adding html next to it e.g.

    *html #rules {}
     
    promotionalhelp, Feb 5, 2009 IP