在css中使用自定义字体
2017-01-20 13:35
453 查看
使用css3的#font-face属性
下面是我使用SourceCodePro的配置。(首先要把字体文件放进去)
如果我们想定义某种字体的多种样式,可以配合sass使用,效果更好。
@font-face { font-family: <YourWebFontName>; src: <source> [<format>][,<source> [<format>]]*; [font-weight: <weight>]; [font-style: <style>]; }
下面是我使用SourceCodePro的配置。(首先要把字体文件放进去)
@font-face { font-family: 'SourceCodePro'; src: url('./assets/font/SourceCodePro.eot'); src: url('./assets/font/SourceCodePro.eot?#iefix') format('embedded-opentype'), url('./assets/font/SourceCodePro.woff') format('woff'), url('./assets/font/SourceCodePro.ttf') format('truetype'); font-weight: normal; font-style: normal; }
如果我们想定义某种字体的多种样式,可以配合sass使用,效果更好。
相关文章推荐
- Html使用CSS自定义字体的总结
- css中自定义字体的使用以及注意事项
- css 自定义字体的使用方法
- HTML5 Canvas绘文本动画(使用CSS自定义字体)
- CSS unicode-range特定字符使用font-face自定义字体
- css网页使用自定义字体方法
- css学习之一使用自定义字体
- css使用自定义字体
- css 使用@font-face 嵌入自定义字体或字体图标方法笔记
- 使用less编译出css引用自定义字体
- css自定义字体font-face的兼容和使用
- [转] css自定义字体font-face的兼容和使用
- WebPart(SharePoint)中如何使用自定义的Javascript和css
- Android教程之如何使用自定义字体
- CSDN中自定义css的使用
- CSS学习之三 字体使用说明
- iPhone 游戏开发中使用自定义字体的方法
- 在网站中使用自定义字体
- 使用Cufon技术实现Web自定义字体
- 使用CSS在页面中嵌入字体