Mikey
Mikey

Reputation: 396

How to use a Google Font once it is installed on your machine

So I know this is a very newbie question but I cant seem to figure this out, don't know what I am doing wrong here. Downloaded a font from Google Fonts, installed it on my machine and am referencing it in my css like this:

* { margin:0; padding:0; font-family:Lobster; }

In my html I just have a p tag:

<p> Hi, this is some text</p>

Are there any extra steps that need to be taken to use a google font installed on your local machine ??

Upvotes: 0

Views: 528

Answers (3)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201518

There are no extra steps that you need to take if you have actually not just downloaded the font but also installed it (so that you can see it e.g. in the font menu of Notepad) and you just want to see that font used when you locally view your own pages.

If you want to use it on web pages, you should generate the relevant font files in different formats, upload them onto your server, and use @font-face syntax that deals with them.

Upvotes: 0

karan3112
karan3112

Reputation: 1867

The correct syntax to use a font is font-family:'Lobster', Arial; Here if the Lobster font is not available it will use the Arial.

Also you can just import a font file in the css.

CSS

@import url(//fonts.googleapis.com/css?family=Lobster:400);
body{ font-family:'Lobster', Arial; }

DEMO

Upvotes: 1

ABHIJIT SURYAWANSHI
ABHIJIT SURYAWANSHI

Reputation: 31

You dont need to download google fonts on your machine to add in your web pages.

Add the following link between your ead tags

<link  rel="stylesheet" href="http://fonts.googleapis.com/css?family=lobster">

Upvotes: 0

Related Questions