简体   繁体   中英

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?

Yes, just use the inherit keyword:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM