3

Despite looking at other answers I cannot get Bootstrap to not override the Google Font I want to use. I have tried changing the position of my stylesheets but nothing works.
Any help with this would be greatly appreciated.

http://codepen.io/01scatman/pen/KzGdNY

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
   <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
   <link rel="stylesheet" type="text/css" href="AOS-TC.css">
    <link href='https://fonts.googleapis.com/css?family=Arvo:400,700' rel='stylesheet' type='text/css'>
Craig
  • 31
  • 2
  • Where do you specify your "arvo" font in your CSS. Use the `@font-face` CSS rule to do this. – ahPo Apr 27 '16 at 21:31

4 Answers4

2

I had the same issue. To solve it, first, in your header put your static CSS link lower than all other ones, i.e. you need something like this

From

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="AOS-TC.css">
<link href='https://fonts.googleapis.com/css?family=Arvo:400,700' rel='stylesheet' type='text/css'>

To

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link href='https://fonts.googleapis.com/css?family=Arvo:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="AOS-TC.css">

Second, add the proper font in your CSS 'body' tag

From

font-family: Arvo;

To

font-family: 'Arvo', sans-serif;

Maybe this is a little bit late. However, I believe it will be helpful for people who might have the same problem in the future.

Anton Morozov
  • 33
  • 1
  • 6
0

I have nothing but the following in a document, and it works. Bootstrap is not overwriting the font.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="AOS-TC.css">
<link href='https://fonts.googleapis.com/css?family=Arvo' rel='stylesheet' type='text/css'>

<style>
  body{
    font-family: 'Arvo', serif;
  }
</style>

Hello
Timothy Kanski
  • 1,861
  • 14
  • 20
0

Maybe try adding "important" on your body CSS

body {
  margin: 0;
  padding: .1px;
  position: relative;
  background: url(http://www.adventuresofscatman.com/wp-content/uploads/2015/09/IMG_4273.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-color: #555;
  overflow-x: hidden;
  font-family: Arvo !important;
  font-weight: 700;
}
Bernie Carpio
  • 321
  • 1
  • 3
  • 10
  • 1
    or you can download the CSS and host it into your server https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css and replace the font-family on the specific tag where you want the Arvo font to apply. – Bernie Carpio Apr 28 '16 at 05:04
0

Not sure why the font is being overridden, but you can use fontSwitcher (on CodePen) to apply it. I tried it on your pen and it applies Arvo. Add this line to the head:

<script src="http://codepen.io/freginold/pen/vLJewY.js"></script>

And this line to the JavaScript section:

fontSwitcher('fontName', 'elementClass');

fontSwitcher applies the Google font by class, so if you want to apply it to the whole body, assign a class to the body and then apply the font to that class.

You can also specify fallback fonts, like this:

fontSwitcher('fontName', 'elementClass'[, 'fallbackFont1', 'fallbackFont2' ...]);

Disclaimer: fontSwitcher is still a work in progress, but it's fully functional.

freginold
  • 3,946
  • 3
  • 13
  • 28
  • Also, adding `font-family: Arvo;` to the `.secondary` class applies Arvo to your sub-heading, so maybe you just need to target the font differently. – freginold Jun 02 '16 at 12:50