更改引导程序时导航栏显示不正确

时间:2019-10-16 05:34:54

标签: asp.net-mvc bootstrap-4

在ASP.NET MVC的默认引导程序中,页面很好 enter image description here enter image description here

但是无论何时更改引导程序,无论引导程序是什么,导航栏都将如下所示:

enter image description here

enter image description here 我该如何解决?我只更改了BudleConfig.cs

bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
    "~/Scripts/modernizr-*"));

bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
    "~/Scripts/bootstrap.js",
    "~/Scripts/respond.js"));

bundles.Add(new StyleBundle("~/Content/css").Include(
    "~/Content/journal-bootstrap.css",
    "~/Content/site.css"));

3 个答案:

答案 0 :(得分:0)

每个引导程序都有其自己的属性。 您正在使用的其中一个包含一些属性,这些属性使导航栏以这种方式显示。

优先级被赋予最新的优先级,因此,即使您具有相同的引导程序,也会根据最新的引导程序显示您提供的内容。

答案 1 :(得分:0)

阅读引导程序的功能并在页面中应用正确的CSS类,即可看到设计。确保捆绑中加载了CSS样式,并且您在bundle_config文件中映射了正确的路径。

https://getbootstrap.com/docs/4.3/getting-started/introduction/

答案 2 :(得分:0)

我已经用您提到的日记bootsrap css覆盖了我的bootstrap css,它看起来像这样。

link for bootstrap css

Image after added journal Boostrap css