伙计们,
我正在尝试将不同的 Bootstrap 版本应用于一个 HTML 文档。在我的文档中,我默认使用最新版本的 Bootstrap (4.4.1),并使用 3.3.7 版本来使用 bootstrap-treeview ( https://github.com/jonmiles/bootstrap-treeview )。
Bootstrap 的两个版本存在冲突,我无法使用两个版本中最好的版本呈现我的页面的全部内容。我正在尝试找到一种方法将 Bootstrap (3.3.7) 版本仅应用于我的 HTML 代码的一个 div。
这是我尝试过的:
<head>
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
</head>
<body>
<!--Some content with Bootstrap 4.4.1-->
<style scoped>
.tree-div {
@import url(https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css);
}
</style>
<div class="tree-div" id="tree-div"></div>
<!--Some content with Bootstrap 3.3.7-->
<div class="tree" id="tree"></div>
</div>
目前我还没有成功完成这项工作。如果您能提供一些见解,那将非常有帮助。
干杯。
PS:我找到了这个材料,但没有一个解决我的问题: