What does <meta http-equiv=“X-UA-Compatible” content=“IE=edge”> do?

后端 未结 12 1420
情书的邮戳
情书的邮戳 2020-11-21 06:11

What\'s the difference if one web page starts with

 
 
   
    

        
12条回答
  •  情歌与酒
    2020-11-21 07:04

    
    

    To make this line work as expected, make sure that:

    1. It is the first element right after
    2. No conditional comments are used before the meta tag, e. g. on the element

    Otherwise some IE versions simply ignore it.

    UPDATE

    These two rules are simplified but they are easy to remember and to verify. Despite MSDN docs stating you can put title and other meta tags before this one, I would not recommend to do so.

    How make it work with conditional comments.

    Interesting article about the order of elements in the head. (blogs.msdn.com, for IE)

    REFERENCE

    From the MSDN documentation:

    The X-UA-Compatible [...] must appear in the header of the webpage (the HEAD section) before all other elements except for the title element and other meta elements.

提交回复
热议问题