Christian Mayne
Christian Mayne

Reputation: 1749

Uninheriting a font-family in css

I am hacking away at a wordpress theme and do not wish to make changes to the main stylesheet, style.css, so all changes need to go into style-custom.css

The stylesheet applies a font-family style to a certain class, but I want that class to defer to the globally defined font.

So this is how the inheritance is working:

style.css:383

div#main-superfish-wrapper ul {
  font-family: Georgia,"Times New Roman",Times,serif;
}

style.css:10

body {
  font-family: Droid Sans;
}

in style-custom.css, I simply wish to cancel out the style defined at style.css:383 and revert to the original definition at style.css:10. I don't wish to redefine the font-family.

Is this possible in straight css?

Upvotes: 1

Views: 329

Answers (1)

Étienne Miret
Étienne Miret

Reputation: 6660

Yes, just use the inherit keyword:

div#main-superfish-wrapper ul {
    font-family: inherit;
}

Upvotes: 3

Related Questions