-2

I am in the process of writing a chrome extension for a specific web site. Web site has already obtained its own css. But my extension adds some content to the page. And I want a specific design - bootstrap.css and bootstrap-theme.css - for that content. So I can't simply link my 2 .css files, because they begin affecting the whole page. I've seen <style scoped></style> but it afects all parent Nodes except mine. Using of <iframe> is impossible: I need content to be written in one page only. So what do I need? That's it:

`<body>
 <div>
  <!-- Here Some page code, that I must not affect with css -->
 </div>
 <div class="myclass" id="need_css">
  <!--Here is my HTML-content, which needs bootstrap css-->
 </div>
</body>`
user3824666
  • 333
  • 1
  • 5
  • 11

1 Answers1

2

Write your CSS using a descendant combinator on every selector.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335