Use system fonts to make your site load faster

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

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

查看所有标签

猜你喜欢:

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

码出高效:Java开发手册

码出高效:Java开发手册

杨冠宝、高海慧 / 电子工业出版社 / 2018-10 / 99.00元

《码出高效:Java 开发手册》源于影响了全球250万名开发工程师的《阿里巴巴Java开发手册》,作者静心沉淀,对Java规约的来龙去脉进行了全面而彻底的内容梳理。《码出高效:Java 开发手册》以实战为中心,以新颖的角度全面阐述面向对象理论,逐步深入地探索怎样成为一位优秀开发工程师。比如:如何驾轻就熟地使用各类集合框架;如何得心应手地处理高并发多线程问题;如何顺其自然地写出可读性强、可维护性好的......一起来看看 《码出高效:Java开发手册》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

在线进制转换器
在线进制转换器

各进制数互转换器

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码