如何引用阿里巴巴矢量图标库的图标

  1. 网页链接:https://www.iconfont.cn/collections/detail?spm=a313x.7781069.1998910419.d9df05512&cid=14726
  2. 选择自己喜欢的图标,添加入库
    在这里插入图片描述
  3. 进入自己的库,点击下载代码
    在这里插入图片描述
  4. 解压下载的压缩文件,找到.html文件,用浏览器打开,上面会介绍三种引用方式。
  5. 示例:(采用springboot搭建的项目,只需引入压缩包中的iconfont.css文件)
package com.xicheng.vue.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author xichengxml
 * @date 2018/12/20
 * @description
 */
@Configuration
public class SpringMvcConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("icon").setViewName("icon");
    }
}
<!-- icon.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>引用阿里矢量图标</title>
    <link rel="stylesheet" type="text/css" href="/css/iconfont.css">
</head>
<body>
    <i class="iconfont icon-chunjishangxin-" style="color: #5daf34"></i>
</body>
</html>

启动项目,访问http://localhost:8080/icon即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值