Use Bootstrap without any conflicts.

  • By Kondakov Valeriy
  • Last update: Sep 23, 2022
  • Comments: 2

Isolated Bootstrap

If you decided to use Bootstrap in several places of your site but including Bootstrap CSS rewrites your styles in other places you should use these CSS files to isolate Bootstrap CSS.


  1. Replace the normal Bootstrap link with one of these in the head of a HTML page.

For Bootstrap 3:

<link rel="stylesheet" href="">

For Bootstrap 4:

<link rel="stylesheet" href="">
  1. Create div element with class="bootstrap" where you want to use Bootstrap styles.
  2. It's ready to use:
<!-- there Bootstrap doesn't work -->
<div class="bootstrap">
    <!-- there Bootstrap works-->
<!-- there Bootstrap doesn't work-->



  • 1

    Data Tables Boostrap


    First of all, thank you for such a simple solution to isolating bootstrap. I've used this in other projects with success. However, now I'm now using dataTables.boostrap4.min.css and I've tried to apply your bootstrap isolation code and it's not working. Any ideas for work-arounds?

    Here is the head of my html to give you an idea of what I'm trying to do. When I use the bootstrap div, it doesn't isolate (I'm guessing because I have the dataTables version of bootstrap too).


  • 2

    Glyphicons returning 404

    Hi! Thank you so much for this solution. Needed to isolate the Bootstrap CSS to a single input field and this worked like a charm.

    However the Glyphicons are not loading. I get a 404 Screen Shot 2019-04-17 at 3 57 01 PM

    Am I doing something wrong? Please guide.