bootstrap之google fonts
bootstrap之google fonts
在学习一个bootstrap时,看到了一行引用代码:@import url(http://fonts.googleapis.com/css?family=Antic+Slab);,于是搜索了一下。
打开相关的网站,显示
/* latin */
@font-face {
font-family: 'Antic Slab';
font-style: normal;
font-weight: 400;
src: local('Antic Slab'), local('AnticSlab-Regular'), url(http://fonts.gstatic.com/s/anticslab/v4/8c9q46CAcsp9TiRX9KLgZPk_vArhqVIZ0nv9q090hN8.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
下面便是相关的搜索结果:
这个是google的字体,主要应用于进入Google Web Fonts 主页引用相关字体时将字体加入到自己的网站,主要有下面的三种方法:
- 方法一:标准式:在head部分加入一串 link 样式,引入Google字库:;
- 方法二:@import 式:@import url(http://fonts.googleapis.com/css?family=Comfortaa|Rosario);
- 方法三:js引入:
WebFontConfig = {
google: { families: [ 'Comfortaa:latin', 'Rosario:latin' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
但是在国内访问的时候, google 字体可能会导致加载速度变得很慢。
链接:https://www.zhihu.com/question/19578734/answer/12322459
http://www.cnblogs.com/fatlyz/p/3999825.html
bootstrap之google fonts的更多相关文章
- 使用 Google Fonts 为网页添加美观字体
前言 文字是网页中很重要的组成部分.为文字选择一个合适的字体,能够更好的展现一个网站的个性,表达所要传递的信息,同时吸引用户来产生兴趣. 说到字体,我们首先会想到 CSS 里面的 font,例如: & ...
- (转)Google Fonts 的介绍与使用
转载自“前端笔记” http://www.cnblogs.com/milly/archive/2013/05/10/google-fonts.html Google Fonts 是什么?(以下翻译为 ...
- Google css & Google fonts
最近用某开源模板做提案的时候, 抓包工具老是有外部Request. 问题出在某css中有这么一句: @import url(https://fonts.googleapis.com/css?famil ...
- Get Started with the Google Fonts API
Get Started with the Google Fonts API This guide explains how to use the Google Fonts API to add fon ...
- 前端 CDNJS 库及 Google Fonts、Ajax 和 Gravatar 国内加速服务
由于某些众所周知的原因,好多开源的 JS 库采用的国外 CDN 托管方式在国内访问速度不如人意.所以我们特意制作了这个公益项目,托管了 CDNJS 的所有开源 JS 库以及反代了 Google Fon ...
- [PostCss] Easily Load Google Fonts with PostCSS Font Magician
Configuring Google Fonts can be quite an annoying process to setup. Using Font Magician with PostCSS ...
- 使用Google Fonts注意事项
Google Fonts是一个字体嵌入服务库. 这包括免费和开源字体系列.用于浏览库的交互式 Web 目录以及用于通过 CSS 和 Android 使用字体的 API. Google 字体库中的流行字 ...
- google fonts 国内使用解决方案
由于众所周知的原因,国内使用google font库有很大的问题. 解决方案1:使用国内镜像如360网站卫士常用前端公共库CDN服务 优点:使用方便 缺点:目标用户包含国外的开发者,不清楚国外用户的加 ...
- 最近在做外贸网站的时候,需要大量的字体来充实页面,就学习了怎么引用Google Fonts
第一步,FQ进入谷歌官方字体网站:https://fonts.google.com 妥妥的. 第二步,点击你所选择字体演示块的右上角的加号,然后你所选择的字体会形成引用链接以及你所要写的css样式. ...
随机推荐
- 常用js函数封装
see them... // 获取网址的get参数 var GET = function(name) { var reg = new RegExp("(^|&)" + na ...
- gradle
http://examples.javacodegeeks.com/core-java/gradle/gradle-hello-world-tutorial/
- JSTL 操作符
el表达式的取值默认顺序: pageScope requestScope sessionScope applicationScope 结构,采用.导航,也称为存取器 ${us ...
- Bill的挑战(bzoj 1879)
Description Input 本题包含多组数据. 第一行:一个整数T,表示数据的个数. 对于每组数据: 第一行:两个整数,N和K(含义如题目表述). 接下来N行:每行一个字符串. Output ...
- BigDecimal 处理集合
1 创建一个BigDecimal 对象 BigDecimal Sum = new BigDecimal(0); 2 一个BigDecimal 对象,保留2位小数点 Sum.setScale(2,B ...
- git push 报错!!!!
[root@NB sh]# git push To git@x0.xx.xxx.x1:yanjing_chenl/IT-DOC.git ! [rejected] master -> master ...
- windows系统 SVN出现 can't open file‘\XXX\txn-current-lock’ 拒绝访问 问题处理
问题描述: 在新建的svn目录下,提交文件出现 如图错误提示.
- Codeigniter的Redis使用
1. ./config/redis.php: <?php $config['redis_host'] = '127.0.0.1'; $config['redis_port'] = '6379'; ...
- haproxy+keepalived
global_defs { router_id LVS_DEVEL } vrrp_script chk_haproxy { script "killall -0 haproxy" ...
- 权限管理[Linux]
chown username file,... 改变文件的属主(只有管理员可以使用此命令) -R:修改目录及其内部文件的属主 -reference=somefile_path file,...把想要设 ...