Search code examples
htmlcssbootstrap-4

Prevent css from bootstrap theme leaking in


I am using a bootstrap css theme on my website but in a certain sub section of it I want to only use the plain bootstrap css. Is this possible without resorting to using an iframe?

For clarity this is what I want:

<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>

Solution

  • I ended up using an iframe and communicating between it and the parent frame with https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API