【问题标题】:Prevent css from bootstrap theme leaking in防止 bootstrap 主题泄露 css
【发布时间】:2023-02-06 04:39:50
【问题描述】:

我在我的网站上使用 bootstrap css 主题,但在它的某个子部分我只想使用普通的 bootstrap css。如果不使用 iframe,这可能吗?

为了清楚起见,这就是我想要的:

<div> <!-- this is styled by both boostrap and theme css -->
  <div> <!-- this as well -->
    <div id="subsection"> <!-- this is styled only by bootstrap css -->
    </div>
  </div>
</div>

【问题讨论】:

  • 您可以使用 :not 选择器。请分享 theme.css
  • 我该怎么做?主题 css 未缩小为 28000 行,因此我无法手动覆盖所有选择器

标签: html css bootstrap-4


【解决方案1】:

我最终使用了一个 iframe 并在它和父框架之间进行了通信 https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-21
    • 2011-08-31
    • 2014-09-01
    • 2021-05-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多