I am wondering if I can get an IE7 browser to render as IE8.
I know this is backwa开发者_高级运维rds compatible by adding a META tag
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
Does anybody have any ideas?
You can't - IE8 is backwards compatible to IE7, but it doesn't work the other way round.
The best you can do is use tools like Modernizr to detect support for features such as border radius, transparent pngs and other things and CSS3Pie to implement a few of these - but nothing will make IE7 as IE8.
What you're asking is basically impossible, as others have commented.
There are, however, an assortment of hacks available which are intended to give older versions of IE the newer features they're missing and to fix bugs.
There are a whole load of them, and they cover different aspects of the browser, but none of them solves every issue -- fundamentally, if you want to use a modern browser, then you need a modern browser, not an old one with hacks.
However, if you are compelled to write a site that supports older browers such as IE7 (or worse, IE6), you can use these hacks to make your life easier.
I'd suggest looking up the following:
- http://css3pie.com/
- http://code.google.com/p/ie7-js/
- http://jquery.com/
- http://www.modernizr.com/
- http://code.google.com/chrome/chromeframe/
Between them, you should be able to get a decent amount of cross-browser compatiblity. But don't ever think you'll get IE7 to emulate IE8.
IE's emulation only works backwards, so IE7 cannot emulate IE8. IE8 obviously didn't exist when IE7 was released, and the IE devs aren't going to update IE7 to emulate IE8 (as they'd rather you just use the latest version).
IE 7 obviously released before IE 8 never knows about the later one. So there cannot be anything that can help you to emulate the IE8 in IE7 perfectly...
https://code.google.com/p/ie7-js/ may give you some of the features you desire
It's same thing that asking if IE9 can render like IE10.
So no it isn't possible.
Since IE7 came before IE8, and does not incorporate all of the fixes or improvements in its engines, it cannot emulate IE8.
To put it another way, would you expect to find a Windows XP mode in Windows 3.11?
精彩评论