Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font family Open Sans not working

I'm using Open Sans font for my website but it is not working across all computer and I can't figure it why.

I'm calling it in my <head> tag. I tried https or http or // and the result is the same.

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

It is well loaded from the browser (status 200).

My CSS looks like this:

body{
  font-family: OpenSans;
}

But my text are rendered with some sans-serif font besides the fact that it mention Open Sans in the CSS inspector. Even if I remove all font-family from the CSS inspector in my Chrome browser, the font doesn't change. Also, if I add !important, nothing change.

What can be the source of this issue?

I already tried this solution without success.

I don't think it's a conflict because it's working on some computer.

like image 839
ZazOufUmI Avatar asked Sep 10 '15 17:09

ZazOufUmI


People also ask

How do you use Open Sans font family?

Example: How to add the Open Sans font in CSSYou can add it using link element to the HTML, or you can add an @import statement to the CSS. Selecting the option will show you a code snippet that you can copy. This contains some additional link elements that contain the preconnect keyword for the rel attribute.

Does Gmail support Open Sans?

Gmail officially only supports two web fonts: Open Sans and Roboto. Don't expect any other web font to render correctly in Gmail.

Is Open Sans a free font?

Open Sans Font Free by Ascender Fonts » Font Squirrel.


2 Answers

Ok, my main error was to use font-family: OpenSans; instead of font-family: 'Open Sans';

like image 170
ZazOufUmI Avatar answered Oct 20 '22 12:10

ZazOufUmI


did you try to reference your CSS with https?

<link href="https://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,700italic,400,600,700" rel="stylesheet" type="text/css">

I tried this with JSFiddle and it work in my Chrome. https://jsfiddle.net/doqvqfhe/1/

Could you give some more code?

like image 34
Philip Szalla Avatar answered Oct 20 '22 13:10

Philip Szalla