How can I ensure that Internet Explorer 11 uses CSS styles from IE9 in my HTML?
I have tried the following code:
<script runat="server">
private void Page_PreRender(object sender, EventArgs e)
{
var meta = new HtmlMeta();
meta.Content = "IE=EmulateIE9";
meta.HttpEquiv = "X-UA-Compatible";
this.Page.Header.Controls.AddAt(0, meta);
}
</script>
or
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">
In order to maintain consistent styles across all versions of Internet Explorer by using IE9 as the standard.
This is the code snippet I am using:
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="~/App_Themes/CocktailSite/master-interno-ie.css" media="screen" />
<!--[else]>
<link rel="stylesheet" type="text/css" href="~/App_Themes/CocktailSite/master-interno.css" media="screen" />
<![endif]-->
It works fine on IE9 where it takes master-interno-ie.css, but on IE11 it reverts back to master-interno.css.
I have looked at various answers here but none seem to work in my specific case.