css3 ------ @font-face

每当看见各种好看的字体就会心动


字体类型:

StringFont FormatCommon extensionsbrowser support
"woff" WOFF (Web Open Font Format) .woff ie, firefox, chrome, safari, opera, android
"truetype" TrueType .ttf firefox, chrome, safari, opera, android
"opentype" OpenType .ttf, .otf firefox, chrome, safari, opera, android
"embedded-opentype" Embedded OpenType .eot ie
"svg" SVG Font .svg, .svgz ios

 

用法:

@font-face {
    font-family:'Segoe UI Light';  
    src:url("../fonts/Segoe-UI-SLight.eot");
    src:local("Segoe UI Light"),local("Segoe WP Light"),local("Segoe Light"),
    url("../fonts/Segoe-UI-Light.eot?#iefix") format("embedded-opentype"),
    url("../fonts/Segoe-UI-Light.woff") format("woff"),
    url("../fonts/Segoe-UI-Light.ttf") format("truetype"),
    url("../fonts/Segoe-UI-Light.svg#web") format("svg");   /* format里必须加引号,url和font-family后面可加可不加,但是也建议加上  */
    font-weight:normal;
    font-style:normal
}

 

 

 参考文献:http://www.paulirish.com/2009/bulletproof-font-face-implementation-syntax/

http://www.w3.org/TR/css3-fonts/

posted @ 2014-05-27 18:38  itahzligen  阅读(131)  评论(0)    收藏  举报