1

I want to write a JavaScript which includes Bootstrap (and Bootstrap Modal) into a page, based on some action in the page.

However, I don't want to stomp on the existing styles in the page, and I won't know what these styles will be included, since this will take place on more than 15 sites, and the developers of each will be continually changing the sites.

The only thing I can guarantee is that <script type="text/javascript" src="path/to/myscript/that/adds/bootstrap.js"></script> will be included in each of the pages' <head> elements.

How can I do this without running into the aforementioned problems?

Sherbrow
  • 17,279
  • 3
  • 64
  • 77
orokusaki
  • 55,146
  • 59
  • 179
  • 257

1 Answers1

1

If everything is already styled with defined classes then I would just instruct your developers to include bootstrap at the top of their style lists. This will help but not necessarily solve your issue because bootstrap may target an element more specifically than the existing styles.

A relevant question already asked: In which order are CSS styles applied?

Community
  • 1
  • 1
Pseudonym
  • 2,052
  • 2
  • 17
  • 38