在浏览器上使用服务器字体文件的字体

论坛 期权论坛 脚本     
匿名技术用户   2021-1-4 10:35   64   0

1.在浏览器上使用服务器字体文件的字体用法

<style>

@font-face{

font-famliy : webfont; /*这里必须写作 webfont,表示服务器字体*/

src : url('font/字体文件1.otf') format("open type")

}

@font-face{

font-famliy : webfont; /*这里必须写作 webfont,表示服务器字体*/

font-style: italic; /*如果需要用斜体字,还要再定义一下@font-face*/

src : url('font/字体文件1.otf') format("open type")

}


h1{

font-family:webfont; /*这里也必须写作 webfont*/

}

可用的字体文件格式:

字体格式 字体属性

otf opentype

ttf truetype

eot embedded-opentype (仅IE支持)

</style>


2.在浏览器上使用客户端本地字体用法

例如本地的Arial字体,也可以是别的字体

@font-face{

font-family: Arial;

src: local('Arial');

}

h1{

font-family:Arial;

}


分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP