SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Div background color only showing in IE

    Hi all,

    I have a table which is being filled dynamically using PHP.
    This is the part of the code in which the problem is;

    HTML Code:
    <table style="margin-top:10px;border:1px solid;" rules="all" cellspacing="0" cellpadding="2">
    <tr>
    <td $style style='padding:0px;height=34px'>
    <div style='background-color=".$kleur1.";height:17px;width=32px;clear:both'>
    <h6 style='text-align:center;margin-top:2px;margin-bottom:2px;padding:0px;width:23px;font-size:9px'>
    " . $content1 . "
    </h6>
    </div>
    <div style='background-color=".$kleur2.";height:17px;width=32px;clear:both'>" . $content . "
    </div>
    </td>
    </tr>
    </table>
    For some reason the background color only shows up IE, but not in Chrome, Firefox and Safari. However, the content of the divs show up in all those browsers.

    I've searched the net and all i could find was something with floating divs.. but i'm pretty sure that's not my problem.

    Is this just wrong code? or is IE doing something wrong (i won't be surprised if that was the case)?

    If u need more info, just ask.

    Regards,

    Ps. I know i should be using a stylesheet but i have my reasons not to

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,296
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    We'd need to see the code from view source after the page has run and not the php.

    It looks as though you have invalid rules in there unless you are tidying them up before output somehow.

    This is not css:

    Code:
    width=32px;
    It should be:
    Code:
     width:32px

  3. #3
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, how could i've missed that
    Thanks for your quick reply, it's solved


Bookmarks

Posting Permissions

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