通用字型 | font-family (Fonts)

  •   CSS 中文开发手册

    通用字型 | font-family (Fonts) - CSS 中文开发手册

    font-family属性为所选元素指定一个或多个字体族名和/或通用族名的优先列表。

    /* A font family name and a generic family name */
    font-family: Gill Sans Extrabold, sans-serif;
    font-family: "Goudy Bookletter 1911", sans-serif;
    
    /* A generic family name only */
    font-family: serif;
    font-family: sans-serif;
    font-family: monospace;
    font-family: cursive;
    font-family: fantasy;
    font-family: system-ui;
    
    /* Global values */
    font-family: inherit;
    font-family: initial;
    font-family: unset;

    网页作者应当至少在font-family列表中添加一个通用的字体族名,因为无法保证用户的计算机内已经安装了指定的字体,也不能保证使用@font-face提供的字体能够正确地下载。提供通用的字体族使得浏览器可以在无法得到最佳字体的情况下使用一个相对接近的备选字体。

    转载请保留页面地址:https://www.breakyizhan.com/css/32423.html
    原文地址:https://www.cnblogs.com/breakyizhan/p/13234058.html