Reputation: 3432
I'm trying to use google web fonts open sans with bootstrap.
I'm loading the fonts with:
I have a site-specific.css that loads after bootstrap. I've tried:
.body { font-family: 'Open Sans', sans-serif;}
and also:
.bootstrap-container *,
.bootstrap-container body,
.bootstrap-container td,
.bootstrap-container tr,
.bootstrap-container div,
.bootstrap-container p,
.bootstrap-container form,
.bootstrap-container input,
.bootstrap-container select,
.bootstrap-container textarea,
.bootstrap-container font {
font-family: 'Open Sans', sans-serif;
}
But it seems that no matter what class selector I use, the fonts don't render and the bootstrap fonts are inherited instead. I'm not sure how to debug this.
Upvotes: 9
Views: 16669
Reputation: 14774
Provided you haven't altered the core files of Bootstrap, I would make this easier on yourself and use their "customise" feature. Re-download it after placing your font names in and replace your existing bootstrap files with the new ones.
You can customise it here:
http://getbootstrap.com/customize/
Doing this will at least ensure that you don't miss something...and please, avoid using !important
as suggested above (unless you really need to).
Hope that helps?
Upvotes: 9
Reputation: 157334
Use CSS !important
.bootstrap-container *,
.bootstrap-container body,
.bootstrap-container td,
.bootstrap-container tr,
.bootstrap-container div,
.bootstrap-container p,
.bootstrap-container form,
.bootstrap-container input,
.bootstrap-container select,
.bootstrap-container textarea,
.bootstrap-container font {
font-family: 'Open Sans', sans-serif !important; <-------- Here
}
Upvotes: 4