加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

html – CSS多字体系列?

发布时间:2020-12-14 23:11:03 所属栏目:资源 来源:网络整理
导读:body { background-color: silver; color: white; padding: 20px; font-family: Arial,Verdana,sans-serif;} 当有多个csv字体系列时,它是什么意思,如上所述? 最佳答案 这意味着如果客户端的浏览器没有可用的先前字体,则字体将回退到列出的下一个字体. 通过

body {
 background-color: silver;
 color: white;
 padding: 20px;
 font-family: Arial,Verdana,sans-serif;
}

当有多个csv字体系列时,它是什么意思,如上所述?

最佳答案
这意味着如果客户端的浏览器没有可用的先前字体,则字体将回退到列出的下一个字体.

通过列出多种字体,即使您列出的第一个字体在浏览器中不可用,您也可以确保客户端看到您要显示的字体.

在你的例子中:

body {
  background-color: silver;
  color: white;
  padding: 20px;
  font-family: Arial,sans-serif;
}

Arial将退回到Verdana,这将回归无衬线

最佳实践:

Start with the font you want,and always end with a generic family,to let the browser pick a similar font in the generic family,if no other fonts are available.

作为一个有趣的花絮字体系列在character by character basis上可能很重要:

The font-family property specifies a list of fonts,from highest priority to lowest. Font selection does not simply stop at the first font named in the list that is on the user’s system. Rather,font selection is done one character at a time,so that if an available font does not have a glyph that can display a character needed,the later available fonts are tried. However,this doesn’t work in Internet Explorer 6 or earlier.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读