1、注冊賬號登陸
2、創建項目
3、搜索想使用的圖標,添加入庫,或者上傳自己的圖標入庫
4、在圖標庫中,將添加的圖標加入項目
5、將項目圖標下載至本地
6、下載文件為
包括三種格式,使用方法不同
- Unicode
- Font class
- Symbol
7、將文件引入頁面開始使用,引入iconfot.css, 如果圖標是多色的,那么就需要引入iconfont.js文件
代碼實現,css
<link rel="stylesheet" href="font/iconfont.css"> <style> @font-face { font-family: 'iconfont'; src: url('iconfont.eot'); src: url('iconfont.eot?#iefix') format('embedded-opentype'), url('iconfont.woff2') format('woff2'), url('iconfont.woff') format('woff'), url('iconfont.ttf') format('truetype'), url('iconfont.svg#iconfont') format('svg'); } .iconfont { font-family: "iconfont" !important; font-size: 32px; font-style: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } </style>
html
<body> <span class="iconfont"></span> <span class="iconfont"></span> <span class="iconfont"></span> <span class="iconfont"></span> <span class="iconfont"></span> <span class="iconfont"></span> <span class="iconfont"></span> <span class="iconfont"></span> </body>
效果圖
大功告成