admin 管理员组

文章数量: 1184232

Internet Explorer 9, Firefox, Opera,Chrome, 和 Safari支持@font-face 规则.
但是, Internet Explorer 9 只支持 .eot 类型的字体, Firefox, Chrome, Safari, 和 Opera 支持 .ttf 与.otf 两种类型字体.
注意: Internet Explorer 8 及更早IE版本不支持@font-face 规则.
——

添加字体

语法:

@font-face{font-family: 字体名称;src: 字体文件在服务器上的相对或绝对路径;}

使用字体

语法:

#d1{/* 中间有空格用双引号 */font-family: 字体名称;}

以chiller字体为例:

<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><title>Document</title><style>@font-face{font-family:'chiller';src:url('CHILLER.TTF');/* IE9 Compat Modes */}body{background-color: #000;}#d1{color: #f00;font-size: 36px;/* 中间有空格用双引号 */font-family: CHILLER;}</style></head><body><divid="d1">
		I love you so much!!!! <br></div></body></html>

效果图:

本文标签: 系统 支持 编程