不同瀏覽器css引入外部字體的方式


/**
 * 字體后綴和瀏覽器有關,如下所示
 * .TTF或.OTF,適用於Firefox 3.5、Safari、Opera 
 * .EOT,適用於Internet Explorer 4.0+ 
 * .SVG,適用於Chrome、IPhone 
 * 比如:
 */
@font-face {
    font-family: 'MyFont';/*定義字體名稱*/
    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;
}

/**
 * 使用字體
 */
body {
    font-family: 'MyFont', serif;
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM