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 with this one, have both, or do something else entirely?
Yes, this is definitely possible and valid (and actually most of the times even necessary). Basically, you can have an arbitrary number of them, as long as you put all of them into the head section of your website. Additionally you should watch out not to have multiple meta elements for the same concern.
<meta http-equiv="">The http-equiv element is considered obsolete and should not be used. To specify the content type of a document, use the charset attribute of the meta element instead.
The http-equiv attribute provides an HTTP header for the information/value of the content attribute. The http-equiv attribute can be used to simulate an HTTP response header.
http-equiv values Other values that can be used with the http-equiv attribute include: content-security-policy. content-length. content-encoding.
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:
Content-Type = "text/html; charset=iso-8859-1"
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With