Force IIS to allow transitional doctype

2019-08-01 02:52发布

问题:

I have a website developed in Visual Studio, and tested with the IIS Express coming with VS. Everything is fine in the testing phase. The website looks good both in Firefox and IE.

But when uploaded to the IIS Server, the site is only normally rendered in Firefox. Crappy in IE.

I found the DOCTYPE was automatically changed from "Transitional" into "Strict". Why do they change this? And how can we force the IIS to display correctly?

回答1:

Are you on the same domain? If so, IE automagically forces one into intranet-friendly compatibility mode. See this answer for a method to force it to avoid that.



回答2:

Your document should contain the doctype. Don't let IIS do it at all.