简体   繁体   中英

Bootstrap isn't working on Angular 11 upon adding to the project

I am trying to use bootstrap 4.6 on angular 11, I have done following steps.

  1. It was installed and listed under the package as "bootstrap": "^4.6.0"

  2. Listed bootstrap inside angular.json under styles :

     "styles": [ "node_modules/bootstrap/dist/css/bootstrap.css", "src/styles.css" ],

    Still its not loading bootstrap

  3. Tried changing directory as in ./node_modules or ../node_modules or node_modules nothing works.

  4. used import bootstrap in style file it works fine but why its not working when I declared it in angular.json .

Please let me know what I do wrong.

You can define different named build configurations on your angular.json, are you including the "styles" inside "build" and "serve" sections? Also can you see the physical css file on your filesystem?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM