问题
I don't want the clear functionality (the X button) in text boxes rendered in IE10 and above. For this, I'm setting the display of the pseudo element -ms-clear
to none
. However, it still shows up when IE is running in Compatibility mode. Since this is an Intranet site, it will always run in Compatibility mode. And there's no workaround for this: http://connect.microsoft.com/IE/feedback/details/783743/disable-ie10-clear-field-button-when-rendering-in-compatibility-mode
Using <add name="X-UA-Compatible" value="IE=edge" />
in web.config to force IE to run in standard mode is not recommended as per msdn, as far as production scenarios are concerned. Is there any other way of getting round this?
回答1:
According to microsfts' official response "The issue you are reporting is by design".Here is a link to official response from microsoft link
回答2:
While it is definitely not recommended in all cases to set X-UA-Compatible
header to IE=edge
, since it leaves control out of your hands which 'edge' version is being selected, this entirely depends on you trusting your code enough to be sufficiently HTML5-compliant to keep rendering correctly in future browsers. If you do, you can ignore the recommendation not to use IE=edge
, that's why it's a recommendation and not forbidden.
More conservatively you could also opt to select a fixed version. If your audience is using a mixed bag of IE9, 10 and 11 installs, and you're sure it works fine in IE9 - use this:
<add name="X-UA-Compatible" value="IE=9" />
This will make all more recent IE's than 9 also render it in IE9 standards compliant mode, which is much better than basic compatibility mode (which is essentially IE7 Quirks).
In a nutshell - recommendations are just that, and can safely be ignored if you are aware of the consequences and take proper precautions.
来源:https://stackoverflow.com/questions/20050416/disable-ie10-clear-field-in-compatibility-mode