简体   繁体   English

基于可用性的基于条件的字体系列选择

[英]Condition based font-family selection on availability

I would like to write css or some thing that it will make font-family dynamic like on user side if user has Helvetica text available then font-family will be Helvetica if not then font-family will be Arial, How to do this? 我想写css或类似的东西,如果用户有可用的Helvetica文本,它将使字体系列像在用户端一样动态,那么字体系列将是Helvetica,如果没有,则字体系列将是Arial,该怎么做?

Thanks in advance 提前致谢

The typical way is to add them all (most specific to most generic) as a comma delimited list in your style rule. 典型的方法是将所有样式(最特定于大多数通用样式)添加为样式规则中的逗号分隔列表。 If the first one is unavailable, the second is used, and if not that one, the third, etc. 如果第一个不可用,则使用第二个,如果不是,则使用第三个,依此类推。

font-family: Helvetica, Arial, sans-serif;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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