IE9 Fails to load responsive layout

2019-07-23 08:28发布

问题:

Update 1:

This looks to be a problem only when I build and publish to IIS. Running in visual studio, there are no issues. IE9 renders correctly.


IE9 is broken, and I don't know how to do any real testing. My site loads correctly for IE8, 10, and 11, Chrome, Firefox, and Opera, but not IE9.

This is what it is supposed to look like (and how it looks in most browsers):

This is what happens in IE 9 (the white bar at the top is for the mobile menu which should be hidden):

So far my only tool has been IE tester, which (if it is reporting errors) I can't figure out how to view. IE9 Mode in IE11 actually looks fine (though I have received complaints from clients so I know IE9 actually is broken)

Here is the order I am loading in the assets in my layout:

@Styles.Render("~/bundles/themes/crisp/css")
@Scripts.Render("~/bundles/jquery")
@Styles.Render("~/bundles/less")
@Scripts.Render("~/bundles/modernizr")

and the bundleconfig

public class BundleConfig
{
    // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725

    public static void AddDefaultIgnorePatterns(IgnoreList ignoreList)
    {
        if (ignoreList == null)
            throw new ArgumentNullException("ignoreList");

        ignoreList.Ignore("*.intellisense.js");
        ignoreList.Ignore("*-vsdoc.js");
        ignoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
        //ignoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled);
        //ignoreList.Ignore("*.min.css", OptimizationMode.WhenDisabled);
    }



    public static void RegisterBundles(BundleCollection bundles)
    {
        bundles.IgnoreList.Clear();
        AddDefaultIgnorePatterns(bundles.IgnoreList);


        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                    "~/Scripts/jquery-{version}.js"));

        /*bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                    "~/Scripts/jquery-ui-{version}.js"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                    "~/Scripts/jquery.unobtrusive*",
                    "~/Scripts/jquery.validate*"));*/

        // Use the development version of Modernizr to develop with and learn from. Then, when you're
        // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
        bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                    "~/Scripts/modernizr-*"));

        /*bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));

        bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                    "~/Content/themes/base/jquery.ui.core.css",
                    "~/Content/themes/base/jquery.ui.resizable.css",
                    "~/Content/themes/base/jquery.ui.selectable.css",
                    "~/Content/themes/base/jquery.ui.accordion.css",
                    "~/Content/themes/base/jquery.ui.autocomplete.css",
                    "~/Content/themes/base/jquery.ui.button.css",
                    "~/Content/themes/base/jquery.ui.dialog.css",
                    "~/Content/themes/base/jquery.ui.slider.css",
                    "~/Content/themes/base/jquery.ui.tabs.css",
                    "~/Content/themes/base/jquery.ui.datepicker.css",
                    "~/Content/themes/base/jquery.ui.progressbar.css",
                    "~/Content/themes/base/jquery.ui.theme.css"));*/

        bundles.Add(new StyleBundle("~/bundles/themes/crisp/css").Include(
                   "~/Content/themes/crisp/css/bootstrap.css",
                   "~/Content/themes/crisp/css/style.css",
                   "~/Content/themes/crisp/css/socialicoregular.css",
                   "~/Content/themes/crisp/css/font-awesome.css",
                   "~/Content/themes/crisp/css/hero-equal-thumb-gallery.css",
                   "~/Content/themes/crisp/css/tabs-toggle.css",
                   "~/Content/themes/crisp/css/portfolio.css",
                   "~/Content/themes/crisp/css/blog.css",
                   "~/Content/themes/crisp/css/gallery-folio-masonry.css",
                   "~/Content/themes/crisp/js/fancybox/source/jquery.fancybox.css",
                   "~/Content/themes/crisp/css/header-1.css"));

        bundles.Add(new ScriptBundle("~/bundles/themes/crisp/js").Include(
                    "~/Content/themes/crisp/js/bootstrap.min.js",
                    "~/Content/themes/crisp/js/custom.js"));

        bundles.Add(new LessBundle("~/bundles/less").Include(
                    "~/Content/NSA.less"));
    }
}

I'm not really sure what other information to provide, but feel free to ask!

The (I think) relevant CSS - in a gist to keep this from getting lengthy

https://gist.github.com/anwyatt/11183367

回答1:

My first guess would be the quirks mode, that has been a major pain in IE for me...