標籤:nio font-face ceo 處理 div mbed gbk 服務 firefox
首先,處理字型,在網頁:https://www.fontsquirrel.com
目前,@ font-face的支援
- Firefox
- Opera
- Chrome
- Safari
- Internet Explorer 9
在舊的瀏覽器使用@ font-face時,不同的瀏覽器支援特定的字型檔。
- IE瀏覽器:EOT
- Mozilla瀏覽器:OTF,TTF
- Safari瀏覽器:OTF,TTF??,SVG
- 歌劇:OTF,TTF??,SVG
- Chrome瀏覽器:TTF,SVG
將其分別轉成.eot .woff .ttf .svg ,然後利用@font-face
@font-face {
font-family:‘fangZheng‘;
src:url(‘../fontface/fangZheng/_gbk_m-webfont.eot‘);
src:url(‘../fontface/fangZheng/_gbk_m-webfont.eot‘) format(‘embedded-opentype‘), /* IE6-IE8 */url(‘//at.alicdn.com/t/font_1474877045_270467.eot?#iefix‘) format(‘embedded-opentype‘), /* IE6-IE8 */url(‘../fontface/fangZheng/_gbk_m-webfont.woff‘) format(‘woff‘) /* chrome、firefox */,url(‘../fontface/fangZheng/_gbk_m-webfont.svg‘) format(‘svg‘);
}
//使用的時候
.banner-text>p{font-family:‘fangZheng‘;}
拓展:
-使用Font Family Reunion這樣的服務,選擇一個可備用的字型,以免字型未載入完或載入失敗,而出現的空白。
-Font Face Observer, 壓縮後大小4KB,這塊也不熟https://github.com/bramstein/fontfaceobserver
-字型載入器——Font Loading polyfill,這塊還不熟。https://github.com/bramstein/fontloader
參考:http://www.w3cplus.com/css3/the-font-face-dilemma.html
網站最佳化之字型