在ASP.NET MVC 5中捆绑CSS之后,网格对齐不起作用

时间:2019-03-14 10:22:31

标签: asp.net asp.net-mvc

将EnableOptimizations值设置为true后,我的网格无法对齐项目。如果我将其设置为false,则可以正常工作。

BundleConfig.cs

        bundles.UseCdn = true;
        BundleTable.EnableOptimizations = true;

        bundles.Add(new StyleBundle("~/bundles/styles")
                      .Include("~/Content/Site/css/bootstrap.min.css", new CssRewriteUrlTransform())
                      .Include("~/Content/Site/css/owl.carousel.css", new CssRewriteUrlTransform())
                      .Include("~/Content/Site/css/magnific-popup.css", new CssRewriteUrlTransform())
                      .Include("~/Content/Site/css/style.css", new CssRewriteUrlTransform())
                      .Include("~/Content/Site/css/Site.css", new CssRewriteUrlTransform())
                      .Include("~/Content/Site/css/jquery.bxslider.min.css", new CssRewriteUrlTransform()));

布局:

<link href="https://fonts.googleapis.com/css?family=Khand:400,500,600,700&amp;subset=latin-ext" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,700,900&amp;subset=latin-ext" rel="stylesheet">
<!-- Styles -->
@Styles.Render("~/bundles/styles")
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
@RenderSection("style", false)

我在哪里出错?你能帮我吗?

0 个答案:

没有答案