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


/ Published in: HTML
Save to your folder(s)

„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.


Copy this code and paste it in your HTML
  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>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.