Holly
Holly

Reputation: 1976

CSS font override issue / trouble with google webfont?

My problem is simple, I have the font set in the body style to a google webfont:

body {
  font: normal 100% 'Poiret One', 'Trebuchet MS', sans-serif;
  color: Grey;
  ...
}

And then later on I want to set the text within a class to Trebuchet MS

#currentpage_content {
  font: 'Trebuchet Ms', Sans-Serif;
  color: red;
  ...
}

The result, is that the color on the text in #currentpage_content is right (it's red) but the font is definitely still 'Poiret One'. The font doesn't seem to change from 'Poiret One' to 'Trebuchet MS' . I also swapped things around a bit, making Trebuchet MS the default but I had the same problem just reversed (Everything was Trebuchet MS even when I set many class fonts to Poiret One.)

Any advice?

Upvotes: 0

Views: 446

Answers (2)

henry bemis
henry bemis

Reputation: 488

try using "font-family" instead of just "font." also, just in case, use double quotations instead of single.

some good debugging tools and resources for css are:

best of luck! and keep asking questions. that's the best way to learn.

Upvotes: 1

Zoltan Toth
Zoltan Toth

Reputation: 47667

You have to use font-family instead of just font

font-family: 'Trebuchet Ms', Sans-Serif;

or specify all the required parameters for font

font: normal 100% 'Trebuchet Ms', Sans-Serif;

Upvotes: 2

Related Questions