apply external CSS to specific area

前端 未结 3 444
挽巷
挽巷 2021-01-18 05:17

I\'d like to import an external CSS (eg. Bootstrap) into my site-- the problem is I\'d like to apply the Bootstrap styles only to a specific region of the page. When I inclu

3条回答
  •  我在风中等你
    2021-01-18 05:46

    I've only tried this locally and not given it any thorough testing but it seems to work fine. I created a div around the content and assigned it an id. Then prefixed all of the bootstrap selectors with the id I assigned the surrounding div. The prefixing was done with a couple of search and replace operations. Perhaps it can be done easier with less

    Forgot to mention that the body selector of the bootstrap.css has to be replaced with the id and not prefixed like the other selectors.

提交回复
热议问题