gpt4 book ai didi

css - 通过 less 和 MVC4 使用 Bootstrap

转载 作者:行者123 更新时间:2023-11-28 12:17:18 24 4
gpt4 key购买 nike

我是 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com