I added bootstrap css in angular-cli.json - styles. Not applying bootstrap styles to my project. I added in package.json and did npm install. How to resolve this?
angular-cli.json
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.css"
]
package.json
"dependencies": {
"bootstrap": "^4.0.0-beta.2"
}
If you are adding the bootstrap path into the angular. json file, make sure it is the styles within the project\architect\build. Not the one in the project\architect\test.
These are the possible reasons: You have a wrong or incorrect link to the bootstrap file. browser caching and history is messing with your html. Other CSS files are overriding the bootstrap file.
No need to update or reinstall your bootstrap just do below mentioned step it will work for you
open angular-cli.json inside styles array and specifying the path of bootstrap like this:
Angular-cli.json:
"styles": [
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.css"
],
Open your style.css and paste this at the top:
@import url("../node_modules/bootstrap/dist/css/bootstrap.min.css")
In your style.css add following line of code on top and let us know.
@import url("../node_modules/bootstrap/dist/css/bootstrap.min.css")
Also check with following line too
@import url("./node_modules/bootstrap/dist/css/bootstrap.min.css")
Hope it will help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With