Using HTML to disable IE8, IE9 compatible view mode tips

Time:2020-7-29

Starting from IE 8, ie has added compatibility mode, which will be rendered with a lower version of IE. However, sometimes this will lead to web page problems, so we usually add the following code to HTML to make ie use the fixed rendering mode:

Copy code

The code is as follows:

< meta http equiv = “x-ua-compatible” content = “ie = 8” > <! — render in IE8 mode — >
< meta http equiv = “x-ua-compatible” content = “ie = 7” > <! — render in IE7 mode — >

However, I have encountered a situation. Only when the compatibility mode is not used can the page display normally in IE8. However, if the mode is set to IE8, CSS3 will be invalid in IE9. It seems that I need to disable compatibility mode for IE8 and IE9 respectively. What shall I do? You can judge the browser version in the background. If it is IE8, it will output content = ie = 8; if it is IE9, it will output content = ie = 9. But this html is impossible to implement. In fact, it can be implemented by using the following code:

Copy code

The code is as follows:

<meta http-equiv=”X-UA-Compatible” content=”IE=9; IE=8; IE=7; IE=EDGE”>