The short answer to the last part of your question is no: IE7 can't be made to work in IE8 mode. So using the X-UA-Compatible
header won't force older versions of IE to think they're a newer version. (if that worked, we could all just start using content="IE-10"
and be done with worrying about backward compatibility forever)
What the X-UA-Compatible
flag does is tell newer versions of IE to fall back into compatibility mode to emulate older versions. So therefore, your content="IE-8"
flag will have no effect on IE7 or IE8, but will make IE9 fall back into IE8 mode.
This means that IE9 will effectively throw away its newer features, in the name of trying to be backward compatible.
If this is what you want from IE9, then by all means use the X-UA-Compatible
header. If it isn't what you want, then don't use it.
(it's worth noting that the backward compatibility modes in IE are known to be not very good at being 100% compatible with real copies of the version they're trying to emulate, so don't think that you'll get a perfect copy of IE8 running in IE9 either -- it'll have it's own quirks that are different to either IE8 or IE9 in normal mode)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…