Limit the scope of bootstrap styles

后端 未结 9 2241
情歌与酒
情歌与酒 2020-11-27 02:56

How do I limit Bootstrap to just the scope of a div? I need to nest the Bootstrap stylesheet inside an ExtJS app for especific divs and both are clashing since they need the

9条回答
  •  春和景丽
    2020-11-27 03:46

    You can fork the bootstrap repo and change bootstrap.less to wrap the bootstrap styles:

    .bootstrap-scope {
        //put bootstrap @includes in here
    }
    

    Then, in the root of the bootstrap project, run make to generate the bootstrap.css file.

    You'll lose the global styles bootstrap assigns to the body and html tags, but you might not want them anyway.

    And then, in your app, give the container you want the .bootstrap-scope class.

提交回复
热议问题