2

I have used my local iis to test the site and now that its been placed on a server the layout looks "odd" with bits missing, mis-alligned, or a table with half the borders one colour and the other half another colour (which I don't have anywhere)

I know, its not the CSS file, the items are pretty much in their respective places (else things would be completely messed up and most things are set in the aspx page anyway), but just small issues such as text that looks aliased, odd table cell widths, thicker than I've mentioned borders, dropdownlist arrows not the set colours, etc.

The only difference I can see is that I have iis 6.1 on my machine and 6.0 on the server.

How to fix this? Its almost like the server is sending the site at a different resolution. It has totally messed up the whole site.

The site will be accessed by ie9 and intranet only.

Aaron Bertrand
  • 242,666
  • 35
  • 420
  • 451
user1468537
  • 693
  • 4
  • 13
  • 27
  • can you include a screen shot identifying some of the of the differences? – Kane Jun 20 '12 at 13:35
  • I've been looking online for simillar issues and apparently it has something to do with the rendering engine of IE, how to set that? in web.config? or how? I will put up some snaps sortly – user1468537 Jun 20 '12 at 13:39
  • If I press F12 document mode is IE7 standard, if I change that to IE9 all is well again? How can I force the server to send IE9 instead of 7? – user1468537 Jun 20 '12 at 13:43
  • 1
    Is is the same in different browsers? – Denis Agarev Jun 20 '12 at 13:45

2 Answers2

7

Sounds like your company policy is rendering intranet websites in "compatibility mode" which breaks some of the more proper CSS.

Try adding this line to the <head> part of your page:

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

Or the following to display in the highest mode available (sometimes this isn't desired, especially in organizations with older versions of IE):

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

This should force the page out of "compatibility mode" and render the page properly.

For more details on the different values for this meta tag, check out this SO question: What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do?

2015 Update - changed the example to something newer than IE8, also included link to a great explanation of the different options

Community
  • 1
  • 1
Chris Young
  • 1,651
  • 11
  • 17
  • 2
    yup that did it, have put in IE=edge which should force the latest rendering engine. Thanks :) – user1468537 Jun 20 '12 at 13:55
  • I second this IE=edge rather than IE=8 -we run IE8 so the original solution by Chris sounds like it should work, but it didn't for me until I changed it to IE=edge – SeeMoreGain Nov 14 '13 at 05:49
0

Maybe it's because you have rules to use|not to use IE compability mode on local intranet and internet.

Also problem can be caused by different applied security rules (some css files may be unavailable due to authorization settings), but it's common using IIS 6.x and 7.x or higher and you have the same...

Denis Agarev
  • 1,513
  • 4
  • 17
  • 32