Font Family Open Sans not being used
Asked Answered
C

1

19

I am using Google's Open Sans Font in my application.

I have defined the stylesheet as instructed:

<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,700'
 rel='stylesheet' type='text/css'>

I then used it on the body selector as:

body {
    font-family: 'Open Sans', sans-serif;
}

I have not defined font family anywhere else. I assume that since I have defined it at the parent, the child elements will automatically inherit it.

However, if I open up the inspector for say an anchor tag in my application and see the computed styles for that tag, I find that (Chrome Latest) the "Rendered Font" says "Times New Roman 18 glyphs" - Is this correct? I was expecting it to say "Open Sans" - Is the Open Sans font not being applied?

Cruce answered 7/4, 2014 at 9:8 Comment(3)
do you have a JSFiddle?Jaguarundi
Cannot reproduce. Does the text look like Open Sans? It should be clearly distinguishable from Times New Roman. “Rendered Font” info in Chrome can be bogus for web fonts.Scheffler
@JukkaK.Korpela Please see the answer - apparently its some kind of bug with chrome (because I don't have the issue with Firefox)Cruce
E
11

Check out the codepen link. Its working fine for me !

.open-sans-font{
  font-family: 'Open Sans', sans-serif;
}
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700" rel="stylesheet">

<div class="open-sans-font">
   Stackoverflow rocks !!!
</div>
Excursus answered 20/10, 2016 at 11:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.