Web Authoring
  Home arrow Web Authoring arrow Page 3 - Using Proper DOCTYPE to Fix Browser Compat...
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? 
WEB AUTHORING

Using Proper DOCTYPE to Fix Browser Compatibility Issues
By: Anthony
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 21
    2005-01-26

    Table of Contents:
  • Using Proper DOCTYPE to Fix Browser Compatibility Issues
  • Stop Beating Yourself Up and Read
  • The Proof is in the Pudding
  • The Truth about Internet Explorer 6

  • 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


    Using Proper DOCTYPE to Fix Browser Compatibility Issues - The Proof is in the Pudding


    (Page 3 of 4 )



    Recent examples of DOCTYPE that include a full URL instruct these browsers to render your page in a standards-compliant mode, treating your XHTML, HTML, XML, CSS and DOM as you expect them to be handled. Using defective or obsolete DOCTYPE, for example a declaration with relative links not established within your site (such as: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""DTD/xhtml1-strict.dtd">) will cause these very same browsers to be alerted to run in what we call “quirk” mode. For more information regarding which browser will alert in Quirk Mode, please reference the diagram below:


    Figure 1Examines which DOCTYPE used on what Platform will alert in Quirk Mode


    Figure 2Examines again which DOCTYPE used on the Mac version of Internet Explorer 5 will alert in Quirk Mode

    It was developed as a norm back in the 1990s that a browser will assume you have written an old-fashioned or invalid string of code and handle this invalid markup as best as it can. Having said that, the browser will attempt to parse your page in a backward non-compatible fashion, rendering your CSS as it might have looked in Internet Explorer 4, and reverting it to a more proprietary, browser–specific DOM.

    Just as an aside: Internet Explorer reverts to the Internet Explorer DOM, while Mozilla and Netscape 6 reverts to something more difficult to describe. The Opera browser does not play by these rules; it always attempts to render pages in standards–compliant mode. Clearly, this is not what you want, but it is often what you’ll get due to the prevalence of incorrect or incomplete DOCTYPE. 

    More Useful Examples

    Below I have provided another example of expectable uses of DOCTYPE (provided by our friends over at ALA):


    Figure 3Demonstrates the other correct conventions of DOCTYPE

    So now that we have you all caught up on the proper and improper ways to incorporate DOCTYPE into your everyday Web designing life, I digress to cover the most focal issue you will encounter when using Internet Explorer 6 and the DTD…Cascading Style Sheets. I picked Windows as the medium of choice to address solely on the basis that most of us (designers) use Internet Explorer to exhibit our work (regardless of what you think of open source, it is still the browser used by the vast majority of Web surfers). For that reason alone, I have gathered the essential tools to suppress the pain of using Internet Explorer 6.

    More Web Authoring Articles
    More By Anthony


       · This was my first article written, so please be gentle but honest. Thank you for...
       · While I appreciate this being your first article, what persuaded you or, better...
       · Great stuff - very useful. But please don't use images to show text. I found the...
       · Many inexperienced web developers often skip over or miss-understand the importance...
     

    WEB AUTHORING ARTICLES

    - Yahoo Pipes: Worth a Look
    - Completing an EAR
    - Building and Deploying an EAR
    - New Nuke Security Sentinel: Worth Taking a C...
    - Administering Your CMS-Based Web Site
    - What You Need to Know Before Using a CMS
    - Introducing the Google Maps API
    - An Overview of the Yahoo User Interface Libr...
    - Basic configuration of osCommerce, concluded
    - Basic configuration of osCommerce, continued
    - Basic configuration of osCommerce
    - Deploying your Site with PHPEclipse, continu...
    - Deploying your Site with phpEclipse
    - Macromedia Captivate Review
    - Macromedia and Adobe Planning to Tie the Knot







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