SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Location
    Cardiff
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question AAarrhh!! Internet Explorer NonCompliance Doing My Head In! Whats the best solution?

    I am a webdesigner and spend a very, very long time trying to get Firefox and Internet Explorer to display websites the same. You can spend hours and hours getting no where!! I understand it's due to Internet Explorer not complying with standards. I hate it!!!!!!

    So... does anyone know of a good, quick and easy solution to overcoming the differences? Every forum help I find always provide tips of actual CSS code for the "generic" stylesheet BUT i was wondering if it would be easier to have different stylesheets and using PHP to deliver the stylesheet for the browser that the user uses. Do you think this would be a good idea?? Som may problems solved. Or better still, have the generic stylesheet for all common css code that does work on both browsers but call another stylesheet for the differences so you dont have any repeated code to update all the time.

    What is everyones opinions? And do you think it would be good to have some sort of sticky in this and other forums that tell people what the best solutions could be to once and for all get around the problem of IE non-compliance (apart from the obvious but impossible task that everyone start using Firefox )? Then there may not be much of a need for us to keep requesting help on css code in one css file that works in all browsers and save us so much time!! Horay!

    Laurie
    Laurence Cope
    Infocom Online Ltd

  2. #2
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by infocom
    Or better still, have the generic stylesheet for all common css code that does work on both browsers but call another stylesheet for the differences so you dont have any repeated code to update all the time.
    You're on the right track. You'd have one CSS file for all browsers and then use conditional comments to serve up stylesheets for IE (or specific versions of IE). These rules will be used to alter the general rules slightly or to apply fixes for IE's bugs.

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by infocom
    i was wondering if it would be easier to have different stylesheets and using PHP to deliver the stylesheet for the browser that the user uses.
    That won't work, because PHP runs on the server side and doesn't know which user agent is requesting the page. Let me qualify that: the server has no reliable way of knowing the user agent. It can check the User-Agent HTTP header, but that may be spoofed or omitted.

    Conditional comments are the best way to deal with this problem, IMHO.
    Birnam wood is come to Dunsinane

  4. #4
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by infocom
    Or better still, have the generic stylesheet for all common css code that does work on both browsers but call another stylesheet for the differences so you dont have any repeated code to update all the time.


    Laurie
    Hi Laurie,

    That's what I would suggest as it's the safest method to serve IE a different stylesheet instead. The advantage is that your master CSS is clean and correct whereas the IE CSS stylesheet accomodates for IE-specific bugs/rendering issues/differences.

    Here's a list of conditional comments you can use (I am using the if lt IE 7 conditional as it covers all versions up to IE 6):

    Code:
    <!--[if lt IE 7]Add your stylesheet link here ...[endif]-->
    This reads "if lower than IE 7, use this stylesheet

    Code:
     <!--[if lte IE 7]Add your stylesheet link here ...[endif]-->
    "If lower than or equal, use this stylesheet

    Code:
      
      <!--[if IE 6]Add your stylesheet link here ...[endif]-->
    "If IE 6, use this stylesheet"

    Code:
      
      <!--[if gt IE 5]Add your stylesheet link here ...[endif]-->
    "If greater than IE5", use this stylesheet

    Code:
      
      <!--[if gte IE 5]Add your stylesheet link here ...[endif]-->
    "If greater than or equal IE5", use this stylesheet


    Code:
      
      <!--[if IE]Add your stylesheet link here ...[endif]-->
    "If IE", use this stylesheet
    Maleika E. A. | Rockatee | Twitter | Dribbble



  5. #5
    SitePoint Addict
    Join Date
    Sep 2003
    Location
    India
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by infocom
    I am a webdesigner and spend a very, very long time trying to get Firefox and Internet Explorer to display websites the same. You can spend hours and hours getting no where!! I understand it's due to Internet Explorer not complying with standards. I hate it!!!!!!So... does anyone know of a good, quick and easy solution to overcoming the differences?
    Hi, Do not hate IE, you will get 1000 so called Hacks in your needs, but I am telling you, if you come across FF bugs, you will hardly find someone to help you a fix on that difficult.

    Best and Safest way is to (if you are busy) always work on 3 popular browser (ie, ns, ff) which is atleast 7-8 years OLD.

    - Experienced WordPress Consultant.
    - Get website design done by Anblik Web Design Company.
    - Collection of Top Free Online Website Builder.
    - Collection of Free Online Website Usability Testing Tools.

  6. #6
    SitePoint Member
    Join Date
    Sep 2006
    Location
    Cardiff
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks all.

    All4nerds, I must admit in my annoyed haste I did not go through the stickys, so I can see the useful info in there now. But I think one good thing I have never been able to find is a definitive and simple list of what exactly are the differences so you know exactly what to code when you build. At the moment it seems as though you build and when you notice a difference you then look for a fix. This way you may have not covered all issues, and its more firefighting. So do your stickys list all the differences and things to take into account?

    Conditional comments sound good. I think they would only be useful though knowing what differences there are as stated above. For example, you list all the different IE version, but I wouldn't have a clue what css code is supported in or not supported in these browsers until I test in everyone and see if there are differences. Would be good to just know what they are, and then have default/standard/example css files you can just use that covers all the points. Or something like that.

    As for IE I cant stop hating it. Its only top because of the MS market share not because its a great browser! Most people who use it have never heard of Firefox or any of the rest. It will all be OK if all browsers conform to standards, or the standards are defined from what MS decides to do. Thats what I think.

    Thanks
    Laurence Cope
    Infocom Online Ltd

  7. #7
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    This might help you further along.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  8. #8
    SitePoint Addict
    Join Date
    Sep 2003
    Location
    India
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    one more thing, i forget to mention, IE is very intelligent and added too many codes in their parser (which is not necessary), is much more efficient then any browsers. stand. compliance (with no bugs) ie browser is coming soon with their new rel.

    - Experienced WordPress Consultant.
    - Get website design done by Anblik Web Design Company.
    - Collection of Top Free Online Website Builder.
    - Collection of Free Online Website Usability Testing Tools.

  9. #9
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by WebCrawler
    one more thing, i forget to mention, IE is very intelligent and added too many codes in their parser (which is not necessary), is much more efficient then any browsers. stand. compliance (with no bugs) ie browser is coming soon with their new rel.
    Huh?


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
  •