Bootstrap 4升级后未样式化

时间:2019-08-20 22:24:58

标签: jquery bootstrap-4

我有一个用Bootstrap 3.7编写的ASP.NET MVC应用程序,我正尝试将其升级到Bootstrap 4.3。我也在使用jquery,jquery UI和jquery Unobtrusive / Validate。

从功能上看,似乎一切正常,并且通过进入页面源代码,右键单击并打开每个文件并进行引用,我已经验证了网站上运行的所有文件(css和js)均为最新版本。所有的下拉菜单和自动完成功能都可以使用。

问题在于,似乎一堆Bootstrap样式未正确应用,特别是但不限于下拉菜单,导航栏和其他一些基本内容。我明白了 enter image description here

代替此: enter image description here

再次,我要强调,一切都正常,这是一个样式问题。这就是我页面上呈现的内容,请注意,所有列出的参考文献都是本地文件,并且都已被验证为最新版本。 enter image description here

FWIW,如果有帮助     公共静态无效RegisterBundles(BundleCollection捆绑包)         {

// Select the node that will be observed for mutations
const targetNode = document.getElementById('some-id');

// Options for the observer (which mutations to observe)
const config = { attributes: true, childList: true, subtree: true };

// Create an observer instance linked to the callback function
const observer = new MutationObserver(callback);

// Start observing the target node for configured mutations
observer.observe(targetNode, config);

1 个答案:

答案 0 :(得分:2)

从Bootstrap 3到4,在用法上存在一些差异,尤其是在类中。

例如,要使导航栏保持在版本4中,请使用.fixed-top.fixed-bottom。您仍在使用.navbar-fixed-bottom

其颜色样式相同。导航栏中有.navbar-inverse,但是在版本4中是.navbar-dark

要检查其余代码,我建议使用此源:Differences Between Bootstrap 3 & 4