Force IE compatibility mode off using tags

后端 未结 12 1509
广开言路
广开言路 2020-11-22 07:56

I am doing work for a client who forces compatibility mode on all intranet sites. I was wondering if there is a tag I can put into my HTML that forces compatibility mode off

12条回答
  •  遥遥无期
    2020-11-22 08:40

    Just a few more notes on this topic based on my recent experiences. The university I work for issues laptops with IE 8 set to compatibility mode for all Intranet Sites. I tried adding the meta tag to disable this mode for pages being served up by my site but IE consistently ignored this tag. As Lance mentioned in his post, adding a response header fixed this issue. This is how I set the header based on the HTML5 boilerplate method:

    
      Header set X-UA-Compatible "IE=edge,chrome=1"
      # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
      
        Header unset X-UA-Compatible
      
    
    

    In order for this header to actually be sent, you have to make sure you have mod_headers turned on in Apache. If you want to make sure you have this mod turned on, put this in a page that can run php:

    
    

提交回复
热议问题