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》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

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

技术管理之巅

技术管理之巅

黄哲铿 / 电子工业出版社 / 2015-6 / 49.00元

《技术管理之巅——如何从零打造高质效互联网技术团队?》为您解密国内顶级互联网公司技术团队管理的精髓。作者结合自己十余年在国内知名互联网公司MySteel、1号店等担任PMO总监、技术总监的丰富经验,进行归纳和总结。书中围绕着技术管理中的热点“如何搭建扁平化、去中心化的技术团队”、“大数据下的技术管理创新”、“目标管理方法OKR”、“阿米巴生产模式”、“Scrum和Kanban的实践”逐渐展开,从技......一起来看看 《技术管理之巅》 这本书的介绍吧!

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具