iconfont阿里巴巴矢量图标库使用步骤
1.注册账号
2.选中图标,添加到购物车
点击购物车,将图标添加到项目
3.在我的项目中,点击下载至本地
4.解压download.zip压缩包,并将解压出来的文件名改成font
5.将font文件夹添加到项目中
6.在style中插入如下代码
@font-face {
font-family: 'iconfont';
src: url('./font/iconfont.woff2?t=1635864529995') format('woff2'),
url('./font/iconfont.woff?t=1635864529995') format('woff'),
url('.font/iconfont.ttf?t=1635864529995') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
7.使用图标的话,先使用这个样式class=“iconfont”,如果图标过小,可以在加一个aa样式。
然后使用图标的代码即可。
8.运行html,浏览器中看效果