首页 > Web开发 > 详细

css3 嵌入字体@font-face

时间:2019-01-30 01:14:59      阅读:185      评论:0      收藏:0      [点我收藏+]

语法:

@font-face {
    font-family : 字体名称;
    src : 字体文件在服务器上的相对或绝对路径;
}
通过给服务器嵌入字体,我们就可以在网页上使用我们想要使用的字体了。
<style> 
@font-face
{
font-family: myFirstFont;
src: url(‘Sansation_Light.ttf‘),
     url(‘Sansation_Light.eot‘); /* IE9+ */
}

div
{
font-family:myFirstFont;
}
</style>

嵌入字体的粗体类型。

@font-face
{
font-family: myFirstFont;
src: url(‘Sansation_Bold.ttf‘),
     url(‘Sansation_Bold.eot‘); /* IE9+ */
font-weight:bold;
}

 

css3 嵌入字体@font-face

原文:https://www.cnblogs.com/zdl2234/p/10336419.html

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