I am attempting to override the default Twitter Bootstrap styles in my Angular application. I am using AngularJS v1.6.8.
My file structure looks like the following:
*src
*app
*public
*styles
*global-styles.css
*index.html
I’ve placed the css I’d like to use to override Twitter Bootstrap styles in global-styles.css.
Currently, I am using “bootstrap-css-only” in order to leverage the default styles provided by Twitter Bootstrap.
I added my global-styles.css to my index.html like so:
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="/">
<link rel="stylesheet" href="/styles/global-styles.css">
My custom styles don’t show up on my index.html and/or on any of the components. Any ideas?
Thank you.
2
Answers
Whatever the new CSS classes you want to override that CSS classes you have to keep in a style.css file. I will work and just add !important in CSS class attributes.
.
This is because base href is set to “/” and failed to load your css altogether.
You can either remove base tag and use relative path:
or set absolute path:
note: you’ll need to replace ROOT_PATH