views:

66

answers:

1

What are the pros and cons of adding

<meta http-equiv="x-ua-compatible" content="IE=8">

to a website. I would like IE 8 to render in the IE 8 Doc mode so styles are more cohesive across browsers. I am just worried about negative consequences of adding this.

+1  A: 

IE8 will render in IE8 standards mode if you provide an appropriate DOCTYPE, like <!DOCTYPE html>. <meta http-equiv="x-ua-compatible" content="IE=8"> is unneeded to force it in this case.

The only consequence of adding it though would be that the soon to be released IE9 will render the page in IE8 compatibility mode. But if you really really wanted to add it for some reason, and still keep IE9 in its own standards mode you can work around it with a conditional comment

<!--[if IE 8]>
  <meta http-equiv="x-ua-compatible" content="IE=8">
<![endif]-->

I just really don't see a point to adding it though. Just have <!DOCTYPE html> that will ensure standards mode in ALL browsers (including even IE6).

Strelok

related questions