Setting div width for Firefox only

Discussion in 'CSS' started by mads, Apr 20, 2008.

  1. #1
    Aloha,

    I have a div element in my header:

    #features {
    width:880px;
    padding-right:18px;
    margin-top: 10px;
    float: center;
    }

    Everything looks great in Firefox, but the page messes up in IE.

    I have tracked the problem down to the width line. If I remove the "width:880px" the page looks fine in IE.

    How can I make sure the width line is only used when the browser is Firefox?

    Thanks, Mads
     
    mads, Apr 20, 2008 IP
  2. mads

    mads Well-Known Member

    Messages:
    762
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Found a solution. PHP script checks the user agent, then use seperate css files depending on the browser.
     
    mads, Apr 21, 2008 IP
  3. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #3
    You can also use conditional comments in CSS for IE, so you can check to see if your visitor is using IE and just remove that line:

    quirksmode.org/css/condcom.html
     
    itcn, Apr 21, 2008 IP