简体   繁体   中英

Is it safe to use inherit in css font-family

I want to use a special font for some HTML element text. But I want to set parent font style when failed rendering special font on browser.

Example CSS code:

.SmoothText {
    font-family: "Special Font name", inherit;
}

Is it safe or not to mix font name and inherit ?

inherit can only exist by itself as a value for any property. What you have is invalid.

If you want to add a font family to a parent font stack, you will need to specify the parent font stack again.

inherit is a property value which means that property takes its value from its parent.

IF you want to add font family to the parent ,font stack has your solution. See this Link

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