-2

Well basically I have implement a auto-generated form using the latest version of bootstrap v4.4. The code is in a JS file which will append the form wherever it is called. Along with bootstrap's CSS CDN.

I found myself in a situation that I need to append the form in a website that uses bootstrap 3.2, which I cannot change that and when I append the JS and the CDN it breaks parts of the other website.

my question is: Is there any way to make to bootstrap 4.4 available only for the elements inside the form's container (div)?

<link rel="stylesheet" href="https://cdnbootstrap44.com>

<div class="append-form-here></div>

<script src="formjs.js"></scritp>

the above is the div that the javascript code will append the form inside. I would like to apply bootstrap 4.4 only to the elements inside it.

isherwood
  • 58,414
  • 16
  • 114
  • 157
noel293
  • 514
  • 5
  • 21

1 Answers1

-1

Included CSS is applied for the whole document, so no.

You could have 'local' css if you enclosed your div in an iframe and included the css there.

You also could add a style="" attribute to your div and include the css snippets used in the elements of the div. The style attributes will only be applied inside the div.

pacukluka
  • 728
  • 4
  • 18
  • yes I am aware of these options! I was just wondering if I could "localized" the b4.4 css for only just that div! – noel293 May 12 '20 at 13:44