在CSS字体家族中使用继承是否安全? [英] Is it safe to use inherit in css font-family
本文介绍了在CSS字体家族中使用继承是否安全?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想对某些HTML元素文本使用特殊字体.但是我想在浏览器上渲染特殊字体失败时设置父字体样式.
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.
示例CSS代码:
.SmoothText {
font-family: "Special Font name", inherit;
}
将字体名称和 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.
这篇关于在CSS字体家族中使用继承是否安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文