000.ttf') format('truetype'), url('000.svg#hakuyoxingshu000') format('svg');} 其中的“000”是你的字体名称,有个缺点就是要考虑到兼容性,以上三种写法分别对应的是:.TTF或.OTF,适用于Firefox 3.5、Safari、Opera .EOT,适用于Internet Explorer 4.0+ .SVG,适用于Chrome、IPhone。
css调用外部中文字体怎么调用?例如方正黑体繁体字体
class{
font-family: 'hakuyoxingshu000Regular';
src: url('000.eot');
src: local('hakuyoxingshu000 Regular'), local('hakuyoxingshu7000'), url('000.ttf') format('truetype'), url('000.svg#hakuyoxingshu000') format('svg');
}
其中的“000”是你的字体名称,有个缺点就是要考虑到兼容性,以上三种写法分别对应的是:
.TTF或.OTF,适用于Firefox 3.5、Safari、Opera
.EOT,适用于Internet Explorer 4.0+
.SVG,适用于Chrome、IPhone。2014-09-22
@font-face{ font-family: 'AntonRegular'; src:url('../fonts/anton-webfont.eot'); src:url('../fonts/anton-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/anton-webfont.woff') format('woff'), url('../fonts/anton-webfont.ttf') format('truetype'), url('../fonts/anton-webfont.svg#antonregular') format('svg'); font-weight:normal; font-style:normal;}放到CSS里面,最好在引用前面用到时候,直接使用font-family:"自命名字体名字",上面的名字就是AntonRegular,这个你自己去定义下面的是字体的路径,要兼容大多数所有浏览器的话,需要转换字体的格式,就像上面的eot/woff/ttf/svg这四种格式,不过中文字体有些是无法转换格式的,所以可能有些效果不是很好2014-09-22