Bootstrap CDN停止显示模态

问题描述 投票:-1回答:2

所以我的样式表如下:

script(src="/js/application.js")
script(src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js")
script(src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js")
link(rel="stylesheet", href="/css/bootstrap.css")
link(rel="stylesheet", href="/css/bootstrap.min.css")
link(rel="stylesheet", href="/css/style.css")
link(rel="stylesheet", href="/css/header.css")
link(rel="stylesheet", href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css")
link(rel="stylesheet", href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js")

现在我使用w3school的标准模型示例来引导:qazxsw poi

如果我点击按钮显示模态,我的HTML页面会失去焦点,但页面上没有任何内容(让我觉得它通常有用,但可能无法显示我的模态)。

如果我删除https://www.w3schools.com/Bootstrap/bootstrap_modal.asp然后模态工作得很好但显然我所有的其他CSS已经消失。

有人知道这个问题,甚至可能有一个修复?

html css bootstrap-modal
2个回答
0
投票

您正在使用2个版本的Bootstrap。如果您想要版本4中的所有CSS,请尝试使用该特定代码。这是链接:link(rel="stylesheet",href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css")


0
投票

我找到了问题,我使用了不兼容的js和css版本的bootstrap。

© www.soinside.com 2019 - 2024. All rights reserved.