首页 > Web开发 > 详细

webfont在vue中的使用

时间:2019-01-04 14:06:20      阅读:258      评论:0      收藏:0      [点我收藏+]

1 下载一个喜欢的字体 tff

http://www.font5.com.cn/tag.php?tag=ttf%B8%F1%CA%BD

2 使用webfont在线生成 

https://www.fontke.com/tool/fontface/

3 项目创建 font.css

@font-face{font-family:‘haha‘; /* 瞎取个名字 */
src: url(‘char.eot‘); /* IE9 */
src: url(‘char.eot‘) format("embedded-opentype"), /* IE6-IE8 */
url(‘char.woff2‘) format("woff"), /* chrome、firefox */
url(‘char.ttf‘) format("truetype"); /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
font-style: normal; font-weight: normal;}

4 vue使用

4.1 引入

import FontStyles from ‘../font/font.css‘

4.2 写样式 font-family

<h2 style="font-family: haha;">super junior example</h2>

webfont在vue中的使用

原文:https://www.cnblogs.com/zhujiujianghuxing/p/10219001.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!