Style Sheets
  Home arrow Style Sheets arrow Page 4 - Cross Browser Issues: CSS Hacks, Understan...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
STYLE SHEETS

Cross Browser Issues: CSS Hacks, Understanding Compatibility
By: Jennifer Sullivan Cassidy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 21
    2006-01-03

    Table of Contents:
  • Cross Browser Issues: CSS Hacks, Understanding Compatibility
  • Know the Browsers
  • Know More Browsers, and Differences
  • How to Handle Differences
  • Another CSS Solution

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Cross Browser Issues: CSS Hacks, Understanding Compatibility - How to Handle Differences


    (Page 4 of 5 )

    How to Handle the Differences

    One thing you can do to help Internet Explorer truly do what you want it to do instead of “figuring it out for you” is to put your web page for IE into quirks mode.  Quirks mode is a rendering mode where a browser tries to handle sloppy code in the way that they did in the mid- to late 90's.  In essence, in quirks mode the browser “purposefully imitates the lax parsing, rendering, and bugs in earlier browser versions so that they render the old, quirkily coded pages exactly the same as they used to.”  On the site, css-discuss.incutio.com, you can find a good list of the quirks that are reproduced in which browsers when using quirks rendering mode

    The problem with this is that if you put your page into quirks mode for IE or older browsers, then you’re putting the page into quirks mode for other browsers as well.  Therefore, you have to use a trigger that will switch between strict mode and quirks mode depending upon the type of browser that is detected.  This is referred to as “doctype switching” which is supported by all modern browsers.  According to the standards, any (X)HTML document should have a doctype which informs the browser of the version of (X)HTML the document is using.  A doctype looks like this:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    The other mode that modern browsers recognize is strict mode.  Your page does not have to validate according to the chosen doctype; the mere presence of the doctype is enough to trigger strict mode.  There is one exception to this rule:  in IE 6, if a doctype that triggers strict mode is preceded by an xml prologue, the page displays in quirks mode.  It looks like this:

    <?xml version="1.0" encoding="iso-8859-1"?>
    This was done to allow CSS coders to achieve valid pages which require a doctype, but still wished their pages to render in quirks mode.  Older browsers completely ignore this tag as well as doctype switching, and operate in quirks mode no matter what.
     

    STYLE SHEETS ARTICLES

    - Image Replacement CSS Techniques
    - Using BlueTrip`s Success, Notice and Error C...
    - More Uses for the Thin and Caps CSS Classes ...
    - Styling Definition Lists with the BlueTrip C...
    - Styling Unordered and Ordered HTML Lists wit...
    - Using the BlueTrip CSS Framework`s Thin and ...
    - Adding Borders to Web Page Columns with Blue...
    - Introducing the BlueTrip CSS Framework
    - Using a Background Grid to Assist Web Page L...
    - Extending the Rule Of Thirds for Web Page La...
    - A Two-Column Web Page Layout Based on the Ru...
    - Using the Rule Of Thirds for Web Page Layout
    - Swapping Columns Using the Divine Ratio for ...
    - Using the Golden Ratio in Liquid Web Page De...
    - Fundamental Design Principles for Web Page L...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek