我是 Bootstrap 和 Less 的新手,正在苦苦挣扎..
我正在尝试从以下站点复制示例,但它们看起来不正常。我究竟做错了什么? http://bootsnipp.com/snipps/credit-card-payment-form-2
我已经通过 Nuget 安装了“Bootstrap Less Source”,还安装了“Bundle Transformer: LESS”以将 Less 转换为 CSS。 我还修改了我的 MVC BundleConfig.cs
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js"));
bundles.Add("~/Content/css").Include(
"~/Content/site.less",
"~/Content/bootstrap/bootstrap.less");
我更新了我的 View 以包含以下内容:
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/bootstrap")
谢谢
最佳答案
看来我的问题与 Bootstrap 的版本有关。 我使用的是 v3.0.0.0,而我查看的样本是 v2.3.2
添加以下链接后,一切正常。
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
谢谢
关于css - 通过 less 和 MVC4 使用 Bootstrap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19088311/