Home arrow Web Authoring arrow Page 3 - Using Proper DOCTYPE to Fix Browser Compatibility Issues
WEB AUTHORING

Using Proper DOCTYPE to Fix Browser Compatibility Issues


Firefox's growing market share provides just one strong argument among many for not designing for a single browser anymore. But how compatible is your website, and what can you do to make it work better with a variety of browsers? Anthony Hart explains the dangers of outdated DOCTYPE, and how to avoid them.

Author Info:
By: Anthony
Rating: 4 stars4 stars4 stars4 stars4 stars / 23
January 26, 2005
TABLE OF CONTENTS:
  1. · Using Proper DOCTYPE to Fix Browser Compatibility Issues
  2. · Stop Beating Yourself Up and Read
  3. · The Proof is in the Pudding
  4. · The Truth about Internet Explorer 6

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

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.


blog comments powered by Disqus
WEB AUTHORING ARTICLES

- Top WordPress Plugins for Social Media
- How to Install WordPress on WAMPP
- More of the Best Wordpress Plugins for Comme...
- Top Wordpress Plugins to Fight Spam
- More of the top Drupal modules for SEO
- Top Drupal Modules for SEO
- More Top Wordpress Plugins for SEO
- Website Optimization Tips
- Backup and Restore a Drupal Website and Data...
- 5 Best Web Font Services
- Web Font Embedding Services
- Joomla Site Administration
- Create PHP Pages that Use WordPress Templates
- Top Joomla Extensions for Social Networking
- Drupal Modules for Site Navigation

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 2 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials