IE=edge and IE=EmulateIE8 - html

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" />

Related

Do old browsers recognizes HTML5 charset format?

I read lots of information on the web, and couldn't find the answer of this quistion. If I use
<meta charset="utf-8"/>
will the coding be applied correctly in browsers that don't support HTML5?
I understand that HTML5 doesn't require closing the meta tag, but closing it seems more decent to make very old browsers at least try to understand it.
Don't know it this thought is correct, but now I wanted to know if I should include that old
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
format or not (wanting HTML4 compatibility).

IE8 will not display frames when http-equiv="X-UA-Compatible" is used

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.

How do I know if the content of my site is compatible with the meta tag X-UA-Compatible/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).

IE8 standards mode meta tag

A web application we have for an organisation that is officially upgrading its standard browser from IE6 to IE8 (queue celebrations), we've set all our DOCTYPEs to be <!DOCTYPE html> (as well as fixed other html code) and I thought that in IE8 this would cause the page to be rendered in IE8 Standards Mode. However, it is still shown in IE7 Standards mode.
I've added the <meta http-equiv="X-UA-Compatible" content="IE=8"> into the <head> section and it still fails to default to IE8 Standards mode. I'm presuming at this stage that there must be a setting (perhaps Group Policy etc) that is forcing the mode.
After reading a hack on an MSDN forum that if you put the meta tag before the <html> tag, it correctly displays as IE8 Standards mode, and this worked for me. Is there another way to do this? It just looks terrible seeing the meta tag there...
Here's roughly how each page is made up:
<!DOCTYPE html>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page Title</title>
</head>
<body>
</body>
</html>
You could set X-UA-Compatible as a HTTP response header, instead of as a meta tag.
This is a much cleaner solution than placing it above the <html> tag.
A confusing useful blog post concerning X-UA-Compatible and its many intricacies:
http://farukat.es/journal/2009/05/245-ie8-and-the-x-ua-compatible-situation
Two possibilities:
The meta tag definitely belongs into the <head> section of the document.
If this is in an Intranet, this may be IE's "Smart default" kicking in. Yes, there is such a thing as smart defaults. See here. Because if you're in an Intranet, IE8 will automatically go into IE7 compatibility mode so as not to break the many corporate apps that rely on IE7. Makes sense, right? Right?

Quest for Minimalistic DTD HTML Language Declaration Standards

In a search towards minimalistic webcoding practices I saw this on the top of my webpages:
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="nl" xml:lang="nl">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="nl"/>
A: when should one keep the second line (xmlns) and when can it be removed?
B: my website is multilingual so pages come in variety of languages. I kept the xmlns since I swa you can put in lang= and xml:lang= so thought that might be handy, but I don't use xml I think... just php generated contents etc. UPDATE I just got advise to use <html lang="de"> which will suffice for me. True?
C: when does one need the third line http-equiv? When can it be removed entirely?
D: do browsers recognize/process the fourth line or do they skip it nowadays?
Thanks very much!
If you haven't already, read up on HTML5 here or maybe here, and maybe even here. HTML5 is the latest HTML spec currently under development by the W3C, and is pretty much awesome.
For your questions:
Q1: See this SO question. Basically, you won't need the xmlns or xml:lang attribute.
Q2: Yes, see below.
Q3: You don't need to specify content-type anymore, however you should always specify the encoding (see below). In reality, though, you can use either one, so I would just stick with the short version. See this SO question for more info.
Q4: That's a difficult question to answer because it really depends on the browser / version. However, it's a moot point since the lang attribute should really be moved into the html tag (again, see below).
Below is what I consider the bare minimum a proper web page should include, (sans the comments):
<!DOCTYPE html>
<html lang="en"> <!-- use whatever language code is appropriate here -->
<head>
<meta charset="utf-8"> <!-- utf-8 is universally the best encoding option -->
<title>My Cool Website</title>
</head>
<body>
</body>
</html>