one css for cross browser

Discussion in 'CSS' started by demons-halo, May 6, 2011.

  1. #1
    im working on a site and im testing in firefox and IE, one problem i come into is the center aligning classes in IE

    how can i use one css file for both browsers without any issues
     
    demons-halo, May 6, 2011 IP
  2. ken.sweet

    ken.sweet Active Member

    Messages:
    683
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    93
    #2
    Is it IE7 or IE8? You can use hacks.
    For IE7:
    *margin:0px;
    For IE8:
    margin:0px\9;
     
    ken.sweet, May 6, 2011 IP
  3. demons-halo

    demons-halo Active Member

    Messages:
    243
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #3
    hi, im using earlier version than ie7, just wanted the website to center align without messing around with crap, but i guess this sort of thing just aint simple lol
    cheers for the help
     
    demons-halo, May 6, 2011 IP
  4. ken.sweet

    ken.sweet Active Member

    Messages:
    683
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    93
    #4
    ok then use this:
    _margin:0px;
     
    ken.sweet, May 7, 2011 IP
  5. kardus

    kardus Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Sometimes using one file isn't always viable based on specific designs. There are ways to do it, but sometimes it will just not work out. If you can't figure it out you can use conditional comments. What this does is includes a different .css file based on what browser it detects, for example. You'll need two files, but it will choose which one to use automatically. This way you can have your site working in both IE and other browsers by fixing the problem in a second file: http://www.quirksmode.org/css/condcom.html
     
    kardus, May 10, 2011 IP