Use system fonts to make your site load faster

栏目: IT技术 · 发布时间: 4年前

内容简介:Although it's great toFor example, I use the following CSSThis uses the default sans-serif fonts on macOS, some Linux distributions and Windows. And if none of them are available, it uses the default sans-serif font chosen by the web browser.

Although it's great to self-host your web fonts instead of using a service like Google Fonts (that may decrease the privacy of your site's visitors, because Google can log IP addresses and other stuff), it's probably not necessary to use web fonts at all. Every PC or tablet or phone has a lot of fonts already pre-installed, which are more than perfect for displaying your website (unless you take a lot of care about corporate design or your personal brand and require a specific font).

For example, I use the following CSS font-family property in my blog and website theme ( view the stylesheet ):

font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;

This uses the default sans-serif fonts on macOS, some Linux distributions and Windows. And if none of them are available, it uses the default sans-serif font chosen by the web browser.

No font files are downloaded when you open my blog. It doesn't need additional HTTP-requests, bandwidth or cache and no font CDN can log your IP address, browser version or other information your browser sends with every request. Additionally the page loads a little bit faster.

You can read more about system fonts here .


以上所述就是小编给大家介绍的《Use system fonts to make your site load faster》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

啊哈C语言!逻辑的挑战(修订版)

啊哈C语言!逻辑的挑战(修订版)

啊哈磊 / 电子工业出版社 / 2017-1 / 49

《啊哈C语言!逻辑的挑战(修订版)》是一本非常有趣的编程启蒙书,《啊哈C语言!逻辑的挑战(修订版)》从中小学生的角度来讲述,没有生涩的内容,取而代之的是生动活泼的漫画和风趣幽默的文字。配合超萌的编程软件,《啊哈C语言!逻辑的挑战(修订版)》从开始学习与计算机对话到自己独立制作一个游戏,由浅入深地讲述编程的思维。同时,与计算机展开的逻辑较量一定会让你觉得很有意思。你可以在茶余饭后阅读《啊哈C语言!逻......一起来看看 《啊哈C语言!逻辑的挑战(修订版)》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具