我有ASP.NET MVC应用程序和im使用Telerik的UI for ASP.NET MVC框架来控制少数控件。
1>应用程序正在使用自举3.3.6
2> Telerik还为其控件提供引导样式。所以我也把这些风格捆绑在一起。
3>,我也有自己的site.css,所以我可以覆盖一些样式。
这是我的BundleConfig.cs
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
// jQuery, bootstrap and kendo JavaScripts are bundled here
// kendo bootstrap-theme CSS
bundles.Add(new StyleBundle("~/Content/kendo-bootstrap/css").Include(
"~/Content/kendo/2016.1.412/kendo.common-bootstrap.min.css",
"~/Content/kendo/2016.1.412/kendo.bootstrap.min.css"));
// bootstrap CSS
bundles.Add(new StyleBundle("~/Content/bootstrap/css").Include(
"~/Content/bootstrap.min.css"));
// site CSS
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/site.css"));
}
}这是im在layout.cshtml中引用它们的方式
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@Styles.Render("~/Content/kendo-bootstrap/css")
@Styles.Render("~/Content/bootstrap/css")
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/kendo/2016.1.412")
@Scripts.Render("~/bundles/bootstrap")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
</body>
</html>我们需要按特定顺序引用CSS吗?推荐的顺序是什么?
发布于 2016-05-03 18:08:33
这将是您的剃刀(cshtml)文件中的顺序:
// Generic bootstrap css
@Styles.Render("~/Content/bootstrap/css")
// Css that kendo overwrites or extends based on bootstrap
@Styles.Render("~/Content/kendo-bootstrap/css")
// Your own css that can override the previous css files
@Styles.Render("~/Content/css")这样,引导程序就不会覆盖由kendo库设置的样式。
https://stackoverflow.com/questions/37010600
复制相似问题