引入字體文件的方法


@font-face {
font-family: SketchRockwell; /*這里是說明調用來的字體名字*/
src: url(‘SketchRockwell.ttf’); /*這里是字體文件路徑*/
}
.my_CSS3_class {
font-family: SketchRockwell; /*這里設置某參數的字體值,在這里是“my_CSS3_class”調用了你剛才聲明的字體值"SketchRockwell"*/
font-size: 3.2em; /*這里是字體大小*/
}

 

字體后綴和瀏覽器有關,如下所示
* .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;
}


免責聲明!

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



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