I was researching about meta tags in HTML and I ended up on a website that suggested that I don't set the name and htt-equiv attribute at the same time. I read somewhere that if I need to support IE8 OR IE9 then it's recommended to use the http-equiv attribute with X-UA Compatible value. My website needs to be supported by older versions of IE so i use the following line of code:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
But at the same time, i also want to provide extra information such as description of my webpage and also specify keywords. Those are set by using the name attributes. Like this:
<meta name="description" content="">
<meta name="author" content="">
<meta name="keywords" content="">
But according to several webpages, I cannot use the http-equiv and name attributes at the same time. So how do I ensure compatibility with older versions of IE and extra information about the webpage at the same time?
I'm quite confused, please enlighten me.
I have come across a website that needs to be compatible with IE 11. While inspecting its source I have notice following meta tag;
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
And checked that its document mode is also 8. In these settings It has a lots of issues. When I updated it to latest i.e. Edge, things become fine again.
Therefore, I have updated the meta tag to;
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
But I just want to know is this safer to update the meta tag I don't know what was there reason of adding IE=EmulateIE8. Or I need to add a some condition for specifically IE11?
I have the following html code that works without the http-equiv="X-UA-Compatible" in IE8 but fails when it has it. I think the order is correct (http://blogs.msdn.com/b/ieinternals/archive/2011/07/18/optimal-html-head-ordering-to-avoid-parser-restarts-redownloads-and-improve-performance.aspx), and the code is valid so I don't see the reason why it would do this.
Please, any explanation?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8, IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<base href="file:///D:/LocalPath/ToFrameElements/">
<title>IE8 stuff</title>
</head>
Your X-UA-Compatible http-equiv string is invalid.
It has 2 values:
IE=8 ( IE 8 standards rendering mode )
IE=edge ( latest engine )
However, the syntax is incorrect. The correct syntax is:
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=edge" />
When multiple values are specified, highest value will be used. That is,
In IE9 , the page will be rendered in IE 9 standards rendering mode.
In IE8 , the page will be rendered in IE 8 standards rendering mode.
Solution: Fix the syntax and retry.
Reference:
https://developer.mozilla.org/en-US/docs/Persona/Browser_compatibility
Define Document Compatibility
Understanding Compatibility Modes in IE8
Sidenote: IE supports this meta tag starting from IE 8.
The base element is defined so that its value must be an absolute URL. Besides, any effect of a file: URL is by definition system-dependent. So you should organize your local files and references to them so that a base tag is not needed.
The frames wouldn't appear because of the standard document mode that the
<meta http-equiv="X-UA-Compatible" content="IE=8, IE=edge" />
or not relaying on the browser's error tolerance, the syntactically correct way
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=edge" />
implies.
This is because in the standard document rendering mode IE does not allow the use of base href with links to the filesystem for security's sake. To have the base href working it can only be achieved by removing the the meta http-equiv="X-UA-Compatible" so that page will run in quirks rendering mode.
see my post here
In that context
What is the meaning of value="IE=edge"?
What is the meaning of value="IE=EmulateIE8" ?
IE=edge simply tells IE to use the last version of the rendering engine.
It's documented here, just like the less useful (in my opinion) IE=EmulateIE8.
IE=edge helps you avoiding some "compatibility" behaviors. It makes IE9 more compatible with other modern engines.
See this related question for example. I always start my HTML files with
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
How can I tell if I should include this meta tag in my site?
<meta http-equiv="X-UA-Compatible" content="IE=edge">
By testing it in various versions of IE (and, as a rule of thumb, if there are problems, fix the problems rather then telling IE to emulate an older version of itself).