1.訪問鏈接轉(zhuǎn)換svg字體的網(wǎng)站

Paste_Image.png
2.導(dǎo)入SVG圖標(biāo)

Paste_Image.png

Paste_Image.png
3.選中你要轉(zhuǎn)換的SVG圖標(biāo)

Paste_Image.png

Paste_Image.png
4.設(shè)置信息
設(shè)置icon名稱以及相關(guān)信息

Paste_Image.png

Paste_Image.png
生成例子以及相關(guān)樣式代碼:

Paste_Image.png
5.主要是生成的css文件
style.css
@font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?xhzg4r');
src: url('fonts/icomoon.eot?xhzg4r#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?xhzg4r') format('truetype'),
url('fonts/icomoon.woff?xhzg4r') format('woff'),
url('fonts/icomoon.svg?xhzg4r#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="icon-"], [class*=" icon-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icomoon' !important;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-appicon:before {
content: "\e902";
}
把生成的fonts里面的所有文件拷貝到你需要的開發(fā)環(huán)境

Paste_Image.png
6.實(shí)際調(diào)用
只需要給相關(guān)的類名即可以,類名就是之前生成的時(shí)候你編寫的名字前面加上icon-,如果沒有改,就是你svg文件的名字。
<span class="icon-appicon"></span>

Paste_Image.png