iconfont官网地址:
https://www.iconfont.cn/collections/index?spm=a313x.7781069.1998910419.3
挑选任意一个图标,加入购物车,下载代码,将代码复制到web项目。
文件结构如图:
![在这里插入图片描述](https://img.php1.cn/3cd4a/1eebe/cd5/eec57030b649a106.webp?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2VudGhhbjgwOTg4Mg==,size_16,color_FFFFFF,t_70)
页面中引入文件:
unicode引入方法:

这个 是看iconfont.json 里面的unicode来的。如图:
![在这里插入图片描述](https://img.php1.cn/3cd4a/1eebe/cd5/8be1ccb5166feb93.webp?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2VudGhhbjgwOTg4Mg==,size_16,color_FFFFFF,t_70)
font-class引入:![在这里插入图片描述](https://img.php1.cn/3cd4a/1eebe/cd5/e62700fe09f8933e.webp?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2VudGhhbjgwOTg4Mg==,size_16,color_FFFFFF,t_70)
这个sop-cgfk-hover也是iconfont.json文件里面找的,如图:
![在这里插入图片描述](https://img.php1.cn/3cd4a/1eebe/cd5/b386c433a16f5497.webp?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2VudGhhbjgwOTg4Mg==,size_16,color_FFFFFF,t_70)
symbol引入(记得引入iconfont.js):
3种引入方式的效果依次如图,但是为什么第三个和前2个不一样???:
![在这里插入图片描述](https://img.php1.cn/3cd4a/1eebe/cd5/99b88427bc9ce0dc.webp)
附: iconfont引入方法的文档地址
https://www.iconfont.cn/help/detail?spm=a313x.7781069.1998910419.16&helptype=code