scope external CSS file for div(no CSS file should link only )

前端 未结 2 737
礼貌的吻别
礼貌的吻别 2021-01-18 07:31

In my page i have three CSS file

bootstrap.css
main.css
icon.css

these are the three file in my page

Function in my page

相关标签:
2条回答
  • 2021-01-18 08:14

    I believe that bootstrap css will always affect the conetent of divs on the entire page.

    To make an area that is not affected, you will need to load the external file into an iframe rather than a div.

    0 讨论(0)
  • 2021-01-18 08:17

    You should use Scoped Stylesheets and JQuery Scoped CSS plugin (due to current lack of browser support).

    Your HTML code would look like this:

    <div class="page">
        <style scoped>
            @import "style.css";
        </style>
        <!-- Your HTML goes here -->
    </div>
    
    0 讨论(0)
提交回复
热议问题