开发者

Can you have multiple http-equiv meta properties?

开发者 https://www.devze.com 2022-12-10 01:05 出处:网络
I don\'t really understand what it does, but it is set in my project to: <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />

I don't really understand what it does, but it is set in my project to:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

I want to force compatibility mode in IE8 off, cos people keep turning it on and it breaks stuff. It's software used on the intranet where everyone has IE8.

I read that I should put this in:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

to force it off. However, should I replace the first line wit开发者_JS百科h this one, have both, or do something else entirely?


Just put those two lines in the head, don't combine them.

You can have as many meta http-equiv tags as you want.

The sames goes for normal meta tags.


Yes, don´t worry. You may have multiple http-equiv lines. In fact, on this case what you are doing is setting 2 different variables:

  1. Content-Type = "text/html; charset=iso-8859-1"
  2. X-UA-Compatible = "IE=EmulateIE8"

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    

In my pages I am setting my X-UA-Compatible as:

<meta http-equiv=\"X-UA-Compatible\" content=\"IE=100\" >

I think IE=100 has the same effect as IE=EmulatesIE8


put the X-UA-Compatible tag at the top of the head section of your document as it needs to be here. Content-type is telling the browser what the document content is and should be placed after t.

0

精彩评论

暂无评论...
验证码 换一张
取 消