分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 软件开发

css引入外部字体

发布时间:2023-09-06 01:53责任编辑:熊小新关键词:暂无标签
<style> @font-face{font-family: myFirstFont;src: url(‘Sansation_Light.ttf‘), ????url(‘Sansation_Light.eot‘); /* IE9+ */}div{font-family:myFirstFont;}</style>

不同浏览器字体的格式有差别

Firefox、Chrome、Safari 以及 Opera 支持 .ttf (True Type Fonts) 和 .otf (OpenType Fonts) 类型的字体。

Internet Explorer 9+ 支持新的 @font-face 规则,但是仅支持 .eot 类型的字体 (Embedded OpenType)。

注释:Internet Explorer 8 以及更早的版本不支持新的 @font-face 规则。

字体后缀和浏览器有关,如下所示* .TTF或.OTF,适用于Firefox 3.5、Safari、Opera * .EOT,适用于Internet Explorer 4.0+ * .SVG,适用于Chrome、IPhone 比如:
@font-face { ???font-family: ‘HansHandItalic‘; ???src: url(‘fonts/hanshand-webfont.eot‘); ???src: url(‘fonts/hanshand-webfont.eot?#iefix‘) format(‘embedded-opentype‘), ????????url(‘fonts/hanshand-webfont.woff‘) format(‘woff‘), ????????url(‘fonts/hanshand-webfont.ttf‘) format(‘truetype‘), ????????url(‘fonts/hanshand-webfont.svg#webfont34M5alKg‘) format(‘svg‘); ???font-weight: normal; ???font-style: normal;}
 

css引入外部字体

原文地址:https://www.cnblogs.com/ccllj/p/9016754.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved