user3125917
user3125917

Reputation: 35

Cannot change the font using font-family in Wordpress

I am new to wordpress and web development. I would like to modify a theme in wordpress but I have a problem. I tried to override the font-family using style.css in the editor, but it doesn't seem to help. I wrote the following:

html, body {
    font-family: Gafata;
}

It doesn't override the original code. What could be my next steps in resolving the problem?Thank you very much in advance!

Upvotes: 2

Views: 304

Answers (1)

Xm7X
Xm7X

Reputation: 861

Put this at the top of your CSS.

@import url("http://fonts.googleapis.com/css?family=Gafata");

If you are not getting the font at that point update your

html, body {
font-family: Gafata;
}

to

html, body {
font-family: Gafata!important;
}

You could use class names on your html, and body tags. If you do not want to use !important.

Like

html.someClass, body.someOtherClass {
font-family: Gafata;
}

Other useful info https://developers.google.com/fonts/docs/getting_started

Upvotes: 1

Related Questions