如何使用Google Fonts字体

如何使用Google Fonts字体,第1张

1、进入Google Web Fonts 主页:http://www.google.com/webfonts 点击“开始选择字体”;

2、从200+字体中选择想要的字体(可惜没有中文字体),选择“使用”;

3、设置你选择字体的样式和字符集;

4、把字体加到你的网站:

方法一:标准式:在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)

})()

5、然后就可以和普通字体一样设置样式了。

WordPress可以使用WP Google Fonts插件,Z-Blog就需要等待了。

你可以尝试搜索字体的网站,例如Font Squirrel、DaFont等,在这些网站上可以找到各种不同的字体。也可以尝试使用Google Fonts,Google Fonts包含了大量的免费字体,可以直接在网页上使用。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/11607282.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-17
下一篇2023-05-17

发表评论

登录后才能评论

评论列表(0条)

    保存