【发布时间】:2021-09-17 16:50:26
【问题描述】:
我想将 bootstrap-5 样式隔离到某个特定的块、页面或 有人可以指导我如何将 bootstrap 5 隔离为 intire 页面或在某些特定的情况下。
【问题讨论】:
标签: html sass less bootstrap-5
我想将 bootstrap-5 样式隔离到某个特定的块、页面或 有人可以指导我如何将 bootstrap 5 隔离为 intire 页面或在某些特定的情况下。
【问题讨论】:
标签: html sass less bootstrap-5
添加保护类来包装你的包含:
.bs-5 {
@import (inline) "@{cssPath}/bootstrap.min.css"
}
然后做这个HTML结构:
<div class="bs-5">
/* .. BS5 specific content .. */
</div>
【讨论】:
您可以使用此链接或自己自定义 saas
https://github.com/onderakbulut/Isolated-Bootstrap-5
然后像这样添加代码sn-ps
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="https://gitcdn.link/repo/onderakbulut/Isolated-Bootstrap-5/main/bootstrap-5.0.1-iso.css" />
</head>
<body>
<div class="bootstrap-iso">
<!-- Bootstrap works only here-->
<div class="container p-5 bg-warning">
Bootstrap 5 İsolated
</div>
</div>
</body>
</html>
【讨论】: