gpt4 book ai didi

css - 如果字体不可用,则继承 font-family 属性

转载 作者:行者123 更新时间:2023-12-03 22:44:14 24 4
gpt4 key购买 nike

我试图让这样的事情工作:

body { 
font-family: Verdana, Arial, sans-serif;
}

p {
font-family: Helvetica, inherit;
}

基本上,如果“Helvetica”在客户端的浏览器上不可用,我希望从父级继承字体系列。但在我看来,我不能在字体优先级列表中使用“继承”。
如何在不必从正文复制粘贴字体系列的情况下实现这样的目标?

最佳答案

你是对的。您可以像以前一样使用它。这是 CSS2 提供的功能。 This question是相似的,并且有一些值得一读的答案。
我认为真正的问题是 Helvetica 不是免费字体。所以,它只是不能广泛使用。

Option 1) If you own the Helvetica font, make an image using that font (for the few lines that you want that specific look for).

Option 2) (as @bjupreti suggested) is to use a substitute font that is widely available.

关于css - 如果字体不可用,则继承 font-family 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53577135/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com