2

CSS3自定义字体

 3 years ago
source link: http://www.hywel.cn/2020/10/16/css3%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AD%97%E4%BD%93/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

CSS3自定义字体

Posted on

2020-10-16 In Web前端

CSS3 @font-face 规则 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规则,网页设计师再也不必使用的”web-safe”的字体之一。 字体的名称,font - face规则: font-family: myFirstFont; 字体文件包含在您的服务器上的某个地方,参考CSS: src: url(‘Sansation_Light.ttf’) 如果字体文件是在不同的位置,请使用完整的URL: src: url(‘http://www.w3cschool.css/css3/Sansation\_Light.ttf') 现在准备使用该字体,下面是如何使用它所有的div元素的一个例子:

@font-face{font-family: FontName;src: url(‘url…’); /* IE9+ */}
div{font-family: FontName;}


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK