Usually, in the actual web page development we can only use the computer already installed fonts such as bold, Arial, JAS and so on, if you encounter a special font what should be done? Some people say that using images instead, this can only be used for the local use of special scenes, is the next strategy.
For example: A registration page "registered members" a few words
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/87/55/wKiom1fdSTvyDqWdAAAyA0T-ru0890.png "title=" 01.png "alt=" Wkiom1fdstvydqwdaaaya0t-ru0890.png "/>
CSS3 introduced by the @font-face This property can be a good solution to this problem, can help us very flexible use of some special fonts, even if the user's computer does not have this font installed, the page can be displayed. Of course, as with other properties, IE8 and the following browsers do not support @font-face
Basic syntax:
Font-family: <family-name>; < Customize the name of a font >
Src:url (Sansation_light.woff); < download good fonts, save paths on your PC >
[Font-variant: <font-variant>;]
[Font-style: <style>;]
}
Like what:
@font-face{
Font-family:fangzheng;
Src:url ('.. /font/fangzheng.ttf ');
}
. modal-content h3{
Text-align:center;
Font-family:fangzheng;
font-size:30px;
Color: #EB980E;
}
Compatibility issues:
Webkit/safari (3.2+): Truetype/opentype TT (. ttf), OpenType PS (. OTf);
Opera (+): Truetype/opentype TT (. ttf), OpenType PS (. OTf), SVG (. svg);
Internet Explorer: Supports font files in EOT format since IE4, IE9 supports woff;
Firefox (3.5+): Truetype/opentype TT (. ttf), OpenType PS (. OTf), WOFF (since Firefox 3.6)
Google chrome:truetype/opentype TT (. ttf), OpenType PS (. OTf), WOFF since version 6
It can be concluded from the above:. EoT +. TTF/.OTF + svg + Woff = Perfect support for all browsers.
Here is a font website dedicated to @font-size http://www.fontsquirrel.com/fontface/generator
The Fontsquirrel Web site offers a free @font-face kit generator tool that can generate different font formats and direct demo with CSS and HTML. So that you can refer directly to your website. You can directly use some of the fonts provided by the Fontsquirrel website, or you can upload your own fonts or use them.
@font-face Kit Generator Demo
http://www.xunzou.com/demo/font-face/Chopin-Script-fontfacekit/demo.html
@font-face Kit Generator Demo
http://www.font2web.com/
@font-face Demo
http://www.xunzou.com/demo/font-face/font-face.html
For more information: refer to Http://www.runoob.com/css3/css3-fonts.html
https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face
This article is from the "Dapengtalk" blog, make sure to keep this source http://dapengtalk.blog.51cto.com/11549574/1853453
@font-size a custom Web page font