• 时间
    
  • 日期时间
    
  • 我我我
    
  • csdn
    
  • gitee2
    
  • 猫咪
    
  • cry
    
  • costoms-alearance
    
  • clock
    
  • Currency Converter
    
  • cut
    
  • data
    
  • Customer management
    
  • descending
    
  • double-arro- right
    
  • customization
    
  • double-arrow-left
    
  • discount
    
  • download
    
  • dollar
    
  • default-template
    
  • editor
    
  • eletrical
    
  • electronics
    
  • auto
    
  • all
    
  • bussiness-man
    
  • component
    
  • code
    
  • copy
    
  • dollar
    
  • history
    
  • editor
    
  • data
    
  • gift
    
  • integral
    
  • nav-list
    
  • pic
    
  • Not visible
    
  • play
    
  • rising
    
  • QRcode
    
  • rmb
    
  • similar-product
    
  • export services
    
  • send inquiry
    
  • all-fill
    
  • favorites-fill
    
  • integral-fill
    
  • namecard-fill
    
  • pic-fill
    
  • play-fill
    
  • prompt-fill
    
  • stop-fill
    
  • 3column
    
  • add-account
    
  • 4column
    
  • add
    
  • agriculture
    
  • 2years
    
  • add-cart
    
  • arrow-right
    
  • arrow-left
    
  • apparel
    
  • all
    
  • arrow-up
    
  • ascending
    
  • ashbin
    
  • atm
    
  • bad
    
  • attachent
    
  • browse
    
  • beauty
    
  • atm-away
    
  • assessed-badge
    
  • bags
    
  • calendar
    
  • 首页
    
  • 工具
    
  • excel
    
  • 组件
    
  • 24gf-pictures
    
  • 特效
    
  • 工具
    
  • sharpicons_Turtle
    
  • git
    

Unicode 引用


Unicode 是字体在网页端最原始的应用方式,特点是:

  • 支持按字体的方式去动态调整图标大小,颜色等等。
  • 默认情况下不支持多色,直接添加多色图标会自动去色。

注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)

Unicode 使用步骤如下:

第一步:拷贝项目下面生成的 @font-face

@font-face {
  font-family: 'iconfont';
  src: url('iconfont.woff2?t=1638513036723') format('woff2'),
       url('iconfont.woff?t=1638513036723') format('woff'),
       url('iconfont.ttf?t=1638513036723') format('truetype');
}

第二步:定义使用 iconfont 的样式

.iconfont {
  font-family: "iconfont" !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

第三步:挑选相应图标并获取字体编码,应用于页面

<span class="iconfont">&#x33;</span>

"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

  • 时间
    .icon-shijian
  • 日期时间
    .icon-riqishijian
  • 我我我
    .icon-wowowo
  • csdn
    .icon-csdn
  • gitee2
    .icon-gitee2
  • 猫咪
    .icon-maomi
  • cry
    .icon-cry
  • costoms-alearance
    .icon-costoms-alearance
  • clock
    .icon-clock
  • Currency Converter
    .icon-CurrencyConverter
  • cut
    .icon-cut
  • data
    .icon-data1
  • Customer management
    .icon-Customermanagement
  • descending
    .icon-descending
  • double-arro- right
    .icon-double-arro-right
  • customization
    .icon-customization
  • double-arrow-left
    .icon-double-arrow-left
  • discount
    .icon-discount
  • download
    .icon-download
  • dollar
    .icon-dollar1
  • default-template
    .icon-default-template
  • editor
    .icon-editor1
  • eletrical
    .icon-eletrical
  • electronics
    .icon-electronics
  • auto
    .icon-auto
  • all
    .icon-all
  • bussiness-man
    .icon-bussiness-man
  • component
    .icon-component
  • code
    .icon-code
  • copy
    .icon-copy
  • dollar
    .icon-dollar
  • history
    .icon-history
  • editor
    .icon-editor
  • data
    .icon-data
  • gift
    .icon-gift
  • integral
    .icon-integral
  • nav-list
    .icon-nav-list
  • pic
    .icon-pic
  • Not visible
    .icon-Notvisible
  • play
    .icon-play
  • rising
    .icon-rising
  • QRcode
    .icon-QRcode
  • rmb
    .icon-rmb
  • similar-product
    .icon-similar-product
  • export services
    .icon-Exportservices
  • send inquiry
    .icon-sendinquiry
  • all-fill
    .icon-all-fill
  • favorites-fill
    .icon-favorites-fill
  • integral-fill
    .icon-integral-fill
  • namecard-fill
    .icon-namecard-fill
  • pic-fill
    .icon-pic-fill
  • play-fill
    .icon-play-fill
  • prompt-fill
    .icon-prompt-fill
  • stop-fill
    .icon-stop-fill
  • 3column
    .icon-column
  • add-account
    .icon-add-account
  • 4column
    .icon-column1
  • add
    .icon-add
  • agriculture
    .icon-agriculture
  • 2years
    .icon-years
  • add-cart
    .icon-add-cart
  • arrow-right
    .icon-arrow-right
  • arrow-left
    .icon-arrow-left
  • apparel
    .icon-apparel
  • all
    .icon-all1
  • arrow-up
    .icon-arrow-up
  • ascending
    .icon-ascending
  • ashbin
    .icon-ashbin
  • atm
    .icon-atm
  • bad
    .icon-bad
  • attachent
    .icon-attachent
  • browse
    .icon-browse
  • beauty
    .icon-beauty
  • atm-away
    .icon-atm-away
  • assessed-badge
    .icon-assessed-badge
  • bags
    .icon-bags
  • calendar
    .icon-calendar
  • 首页
    .icon-shouye
  • 工具
    .icon-gongju
  • excel
    .icon-excel
  • 组件
    .icon-zujian
  • 24gf-pictures
    .icon-24gf-pictures
  • 特效
    .icon-texiao
  • 工具
    .icon-gongju1
  • sharpicons_Turtle
    .icon-sharpicons_Turtle
  • git
    .icon-git

font-class 引用


font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。

与 Unicode 使用方式相比,具有如下特点:

  • 相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。
  • 因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。

使用步骤如下:

第一步:引入项目下面生成的 fontclass 代码:

<link rel="stylesheet" href="./iconfont.css">

第二步:挑选相应图标并获取类名,应用于页面:

<span class="iconfont icon-xxx"></span>

" iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

  • 时间
    #icon-shijian
  • 日期时间
    #icon-riqishijian
  • 我我我
    #icon-wowowo
  • csdn
    #icon-csdn
  • gitee2
    #icon-gitee2
  • 猫咪
    #icon-maomi
  • cry
    #icon-cry
  • costoms-alearance
    #icon-costoms-alearance
  • clock
    #icon-clock
  • Currency Converter
    #icon-CurrencyConverter
  • cut
    #icon-cut
  • data
    #icon-data1
  • Customer management
    #icon-Customermanagement
  • descending
    #icon-descending
  • double-arro- right
    #icon-double-arro-right
  • customization
    #icon-customization
  • double-arrow-left
    #icon-double-arrow-left
  • discount
    #icon-discount
  • download
    #icon-download
  • dollar
    #icon-dollar1
  • default-template
    #icon-default-template
  • editor
    #icon-editor1
  • eletrical
    #icon-eletrical
  • electronics
    #icon-electronics
  • auto
    #icon-auto
  • all
    #icon-all
  • bussiness-man
    #icon-bussiness-man
  • component
    #icon-component
  • code
    #icon-code
  • copy
    #icon-copy
  • dollar
    #icon-dollar
  • history
    #icon-history
  • editor
    #icon-editor
  • data
    #icon-data
  • gift
    #icon-gift
  • integral
    #icon-integral
  • nav-list
    #icon-nav-list
  • pic
    #icon-pic
  • Not visible
    #icon-Notvisible
  • play
    #icon-play
  • rising
    #icon-rising
  • QRcode
    #icon-QRcode
  • rmb
    #icon-rmb
  • similar-product
    #icon-similar-product
  • export services
    #icon-Exportservices
  • send inquiry
    #icon-sendinquiry
  • all-fill
    #icon-all-fill
  • favorites-fill
    #icon-favorites-fill
  • integral-fill
    #icon-integral-fill
  • namecard-fill
    #icon-namecard-fill
  • pic-fill
    #icon-pic-fill
  • play-fill
    #icon-play-fill
  • prompt-fill
    #icon-prompt-fill
  • stop-fill
    #icon-stop-fill
  • 3column
    #icon-column
  • add-account
    #icon-add-account
  • 4column
    #icon-column1
  • add
    #icon-add
  • agriculture
    #icon-agriculture
  • 2years
    #icon-years
  • add-cart
    #icon-add-cart
  • arrow-right
    #icon-arrow-right
  • arrow-left
    #icon-arrow-left
  • apparel
    #icon-apparel
  • all
    #icon-all1
  • arrow-up
    #icon-arrow-up
  • ascending
    #icon-ascending
  • ashbin
    #icon-ashbin
  • atm
    #icon-atm
  • bad
    #icon-bad
  • attachent
    #icon-attachent
  • browse
    #icon-browse
  • beauty
    #icon-beauty
  • atm-away
    #icon-atm-away
  • assessed-badge
    #icon-assessed-badge
  • bags
    #icon-bags
  • calendar
    #icon-calendar
  • 首页
    #icon-shouye
  • 工具
    #icon-gongju
  • excel
    #icon-excel
  • 组件
    #icon-zujian
  • 24gf-pictures
    #icon-24gf-pictures
  • 特效
    #icon-texiao
  • 工具
    #icon-gongju1
  • sharpicons_Turtle
    #icon-sharpicons_Turtle
  • git
    #icon-git

Symbol 引用


这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇文章 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:

  • 支持多色图标了,不再受单色限制。
  • 通过一些技巧,支持像字体那样,通过 font-size, color 来调整样式。
  • 兼容性较差,支持 IE9+,及现代浏览器。
  • 浏览器渲染 SVG 的性能一般,还不如 png。

使用步骤如下:

第一步:引入项目下面生成的 symbol 代码:

<script src="./iconfont.js"></script>

第二步:加入通用 CSS 代码(引入一次就行):

<style>
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>

第三步:挑选相应图标并获取类名,应用于页面:

<svg class="icon" aria-hidden="true">
  <use xlink:href="#icon-xxx"></use>
</svg>