We Recommend

HTML: The Definitive Guide HTML: The Definitive Guide
They teach you that learning HTML is like learning any other language and that reading a book of rules can only take you so far. Readers begin writing what may be their first Web page just two pages into the book's second chapter. From there on, they provide a wide range of HTML coding to allow readers to learn from good examples. The book includes a handy "cheat sheet" of HTML codes for quick reference.


Posted By

localhorst on 03/24/08


Tagged

browser ie5 ie7 IE8


Versions (?)


Who likes this?

4 people have marked this snippet as a favorite

jonhenshaw
SpinZ
visuallyspun
titox


How to set IE8 in previous (IE7, IE5) rendering mode for backwards compatibility


Published in: HTML 


URL: http://msdn2.microsoft.com/en-us/library/cc288325(VS.85).aspx#SetMode

„Versioning and Cross-document InteractionInternet Explorer 8 introduces the IE8 standards mode by default—this lets Web designers use the latest rendering features available in Internet Explorer 8. In addition to layout changes, IE8 standards mode will also affect the behavior of scripted APIs (DOM). To opt-out of IE8 standards mode, the META tag may be used to obtain IE7 compatibility mode“

Take a look at http://code.google.com/p/ie7-js/ too. This is a tiny JS library to makes IE versions behave like a standard browser.

  1. /* -- send as http header too -- */
  2. // in PHP
  3. header('X-UA-Compatible:IE=7');
  4.  
  5. <meta http-equiv="X-UA-Compatible" content="IE=7">
  6.  
  7. <meta http-equiv="X-UA-Compatible" content="IE=4"> <!-- IE5 mode -->
  8. <meta http-equiv="X-UA-Compatible" content="IE=7.5"> <!-- IE7 mode -->
  9. <meta http-equiv="X-UA-Compatible" content="IE=100"> <!-- IE8 mode -->
  10. <meta http-equiv="X-UA-Compatible" content="IE=a"> <!-- IE5 mode -->
  11.  
  12. <meta http-equiv="X-UA-Compatible" content="IE=7; IE=8" />
  13.  
  14. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
  15. <!-- Choose IE7 mode -->
  16. <meta http-equiv="X-UA-Compatible" content="IE=7" />
  17. <title>My Web Page</title>
  18. </head>
  19. <p>Content goes here.</p>
  20. </body>

Report this snippet 

You need to login to post a comment.