Browser Compatibility

Discussion in 'PHP' started by gasper000, Jan 20, 2009.

  1. #1
    This time it's a simple question. How to make the site compatible with all the famous browsers (IE, Firefox, Opera, Safari,etc...) ?!
     
    gasper000, Jan 20, 2009 IP
  2. osmasters

    osmasters Well-Known Member

    Messages:
    453
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    100
    #2
    Just try to give all syntax in html tag.
    like most developers are using simply <td> in number of places and ie and firefox will display it in different way. one will display in center and other will be in right side. you can solve this by giving <td align='center'> and then it will work for all browsers.
     
    osmasters, Jan 20, 2009 IP
  3. WPGLamour

    WPGLamour Active Member

    Messages:
    30
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    95
    #3
    osmasters, are you still using tables? Pff, tables are dead.
    If you want your site to look the same in most browsers the key is to use div tags and a lot of css.
    Then use a css reset method at the start of the css file.
    I personaly use this:
    * {
    margin: 0;
    padding: 0;
    border: none;
    }
    PHP:
    You can find a lot of css reset methods.
    Mine isn't the best but it works for what I need.

    After you do this you need to put different css files for theIE browser.
    This css file will be loaded only in IE7
    <!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="ie7.css" />
    <![endif]-->
    PHP:
    This css file will be loaded only in IE6
    <!--[if IE 6]>
    <link rel="stylesheet" type="text/css" href="ie7.css" />
    <![endif]-->
    PHP:
    This css file will be loaded only in IE, regardless of version.
    <!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="ie7.css" />
    <![endif]-->
    PHP:
     
    WPGLamour, Jan 20, 2009 IP
    gasper000 likes this.
  4. tarponkeith

    tarponkeith Well-Known Member

    Messages:
    4,758
    Likes Received:
    279
    Best Answers:
    0
    Trophy Points:
    180
    #4
    without the 7s, right? :)
     
    tarponkeith, Jan 20, 2009 IP
    gasper000 likes this.
  5. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #5
    Just conform to standards and write a hacks file for IE, easiest way I've found.

    Dan.
     
    Danltn, Jan 20, 2009 IP
  6. fatedesign

    fatedesign Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Use IE hacks like the famous * and #
     
    fatedesign, Jan 20, 2009 IP
    gasper000 likes this.
  7. mywebwork

    mywebwork Guest

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    If your site uses JavaScript make sure you test it with the IE 8 beta - I've found a lot of JavaScript that won't run with this browser although it runs fine with IE 6 & 7.
     
    mywebwork, Jan 20, 2009 IP
  8. WPGLamour

    WPGLamour Active Member

    Messages:
    30
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    95
    #8
    In some rare occasions you have to use different css files for IE7 and IE6.
    IE is stupid like that you know :)
     
    WPGLamour, Jan 26, 2009 IP