0

I'm trying to override bootstrap's default fonts,

but all answers tell me to load my custom CSS file after I load bootstrap's CSS file, although I'm using bootstrap in asp.net project, so I think this is not possible (failed to achieve that).

so what is the best practice to override bootstrap's fonts ?

I'm trying to find a simple way without modifying bootstrap's file nor using !important statements.

many thanks in advance. =)

iYazee6
  • 826
  • 12
  • 22
  • http://stackoverflow.com/questions/18740757/using-a-different-font-with-twitter-bootstrap – Hbirjand Nov 02 '14 at 05:55
  • Prerequisite: http://stackoverflow.com/questions/20721248/best-way-to-override-bootstrap-css – Hbirjand Nov 02 '14 at 05:56
  • @Hbirjand I did see all these questions as I mentioned I can't put the custom css file after the bootstrap's CSS file, and I don't like using '!important' in my CSS file. thank you for your help. – iYazee6 Nov 02 '14 at 06:26
  • 1
    Just edit the bootstrap css file, not that hard, and doesn't cause any damage to the integrity of bootstrap. – MarshallOfSound Nov 02 '14 at 08:28
  • @MarshallOfSound yeah but if I wanted to upgrade or update with a new version I'll have more trouble with that. many thanks for your answer – iYazee6 Nov 11 '14 at 06:42
  • You shouldn't be upgrading to a new version on the same project anyway. it could cause all sorts of incompatibily issues – MarshallOfSound Nov 12 '14 at 00:32

2 Answers2

1

I guess you can customize your Bootstrap online, that can be done on the download page of Bootstrap.

poashoas
  • 1,790
  • 2
  • 21
  • 44
  • Yeah but this is the same problem because as I mentioned before in the future if I wanted to upgrade or update bootstrap I'll have more problems with that, So I want to make it a simple and clean as it is. also many thanks for your answer. – iYazee6 Nov 11 '14 at 06:41
  • 1
    You should just write your own stylesheet with your fonts and everything you want to do and then include after the bootstrap file. Inline styles are a monster to try to maintain. It might look easy, but if you want to make a font change you will have to go and find EVERY inline style and change it. Try very hard not to write any inline css, unless it will stay there until the page is rewritten. – M H Nov 11 '14 at 14:17
0

I can assure you that you can override with include order.

Also, why are you so against modifying your current bootstrap file?

If all else fails. Declare your fonts in the head on master page. Or on main Div on each page. Inline styles will override external stylesheets.

M H
  • 2,179
  • 25
  • 50
  • I'm against modifying the bootstrap file because in the future if I wanted to upgrade or update bootstrap I'll have more problems with that, So I want to make it a simple and clean as it is. many thanks for your answer. – iYazee6 Nov 11 '14 at 06:39
  • 1
    It's not always true that inline styles override external stylesheets. If the external style uses the !important declaration an inline style would not override. I doubt bootstrap does it for fonts but just wanted to clarify your last sentence. – Jim S. Apr 21 '15 at 16:35