• Question
    
  • error
    
  • 成功-success
    
  • row
    
  • tab
    
  • 导航
    
  • One button alarm
    
  • form
    
  • layout
    
  • csv
    
  • number
    
  • 百分比
    
  • date
    
  • id-card
    
  • Select
    
  • drop down
    
  • drop down-up
    
  • icomoon italic
    
  • bold
    
  • 颜色选择器
    
  • underline
    
  • merge-cell
    
  • wrap
    
  • align-right
    
  • undo
    
  • redo
    
  • align-left
    
  • align-center
    
  • 字体颜色
    
  • reduce
    
  • add
    
  • setting
    
  • stop
    
  • Refresh
    
  • calculator
    
  • chrome
    
  • columns
    
  • desktop
    
  • diamond
    
  • frown-o
    
  • tags
    
  • tasks
    
  • mobile
    
  • user
    
  • ambulance
    
  • eye
    
  • magic
    
  • paw
    
  • tree
    
  • 
    trophy
    
  • truck
    
  • user-plus
    
  • user-times
    
  • twitch
    
  • sun-o
    
  • sum
    
  • filter
    
  • time
    
  • switch
    
  • clear
    
  • lock
    
  • Home, homepage, menu
    
  • save
    
  • image
    
  • txt
    
  • woman
    
  • volume-off
    
  • man
    
  • share
    
  • search
    
  • water
    
  • msg
    
  • close
    
  • delete
    
  • dollar
    
  • remove
    
  • add
    
  • arrows-alt
    
  • arrow-circle-o-down
    
  • arrow-circle-o-left
    
  • arrow-circle-o-right
    
  • arrow-circle-o-up
    
  • bicycle
    
  • binoculars
    
  • 
    birthday-cake
    
  • bomb
    
  • bus
    
  • cab
    
  • calendar
    
  • chain
    
  • child
    
  • circle
    
  • clipboard
    
  • clone
    
  • cloud
    
  • copyright
    
  • coffee
    
  • eur
    
  • fax
    
  • file-archive-o
    
  • file-text-o
    
  • file-word-o
    
  • git
    
  • meh-o
    
  • minus-circle
    
  • music
    
  • question-circle
    
  • sitemap
    
  • spinner
    
  • upload
    
  • volume-down
    
  • volume-up
    
  • weibo
    
  • windows
    
  • wordpress
    
  • wrench
    
  • trash
    
  • thumbs-up
    
  • th-large
    
  • thumbs-down
    
  • table
    
  • apple
    
  • adjust
    
  • angle-double-down
    
  • angle-double-left
    
  • angle-double-right
    
  • angle-double-up
    
  • angle-down
    
  • angle-left
    
  • 
    angle-right
    
  • angle-up
    
  • android
    
  • arrows
    
  • arrows-h
    
  • arrows-v
    
  • at
    
  • bell
    
  • bell-slash
    
  • backward
    
  • ban
    
  • bank
    
  • bar-chart
    
  • barcode
    
  • bars
    
  • battery-0
    
  • battery-1
    
  • battery-2
    
  • battery-3
    
  • battery-4
    
  • bug
    
  • building
    
  • bullhorn
    
  • bullseye
    
  • bolt
    
  • book
    
  • caret-down
    
  • caret-left
    
  • caret-right
    
  • caret-up
    
  • check
    
  • comment
    
  • commenting
    
  • comments
    
  • cny
    
  • code
    
  • css3
    
  • cut
    
  • database
    
  • envelope
    
  • exchange
    
  • edit
    
  • file-audio-o
    
  • file-excel-o
    
  • file-image-o
    
  • flag
    
  • folder
    
  • file-movie-o
    
  • file-o
    
  • file-pdf-o
    
  • file-powerpoint-o
    
  • folder-open
    
  • font
    
  • hand-peace-o
    
  • heart
    
  • heartbeat
    
  • heart-o
    
  • key
    
  • keyboard-o
    
  • info-circle
    
  • internet-explorer
    
  • list
    
  • mail-forward
    
  • mail-reply
    
  • map
    
  • map-marker
    
  • phone
    
  • play
    
  • repeat
    
  • qq
    
  • qrcode
    
  • recycle
    
  • share-alt
    
  • sort
    
  • sort-asc
    
  • sort-desc
    
  • star
    
  • star-half-empty
    
  • star-o
    
  • umbrella
    
  • unlock
    
  • wechat
    
  • wifi
    

Unicode 引用


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

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

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

Unicode 使用步骤如下:

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

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

第二步:定义使用 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"。

  • Question
    .icon-question
  • error
    .icon-error
  • 成功-success
    .icon-success
  • row
    .icon-row
  • tab
    .icon-tab
  • 导航
    .icon-daohang
  • One button alarm
    .icon-button
  • form
    .icon-form
  • layout
    .icon-layout
  • csv
    .icon-csv
  • number
    .icon-number
  • 百分比
    .icon-baifenbi
  • date
    .icon-date
  • id-card
    .icon-idcard
  • Select
    .icon-select
  • drop down
    .icon-drop-down
  • drop down-up
    .icon-drop-up
  • icomoon italic
    .icon-italic
  • bold
    .icon-bold
  • 颜色选择器
    .icon-colorSelector
  • underline
    .icon-underline
  • merge-cell
    .icon-merge-cell
  • wrap
    .icon-wrap
  • align-right
    .icon-align-right
  • undo
    .icon-undo
  • redo
    .icon-redo
  • align-left
    .icon-align-left
  • align-center
    .icon-align-center
  • 字体颜色
    .icon-font-colors
  • reduce
    .icon-reduce
  • add
    .icon-expand
  • setting
    .icon-setting
  • stop
    .icon-stop
  • Refresh
    .icon-refresh
  • calculator
    .icon-calculator
  • chrome
    .icon-chrome
  • columns
    .icon-columns
  • desktop
    .icon-desktop
  • diamond
    .icon-diamond
  • frown-o
    .icon-frown
  • tags
    .icon-tags
  • tasks
    .icon-tasks
  • mobile
    .icon-mobile
  • user
    .icon-user
  • ambulance
    .icon-ambulance
  • eye
    .icon-eye
  • magic
    .icon-magic
  • paw
    .icon-paw
  • tree
    .icon-tree
  • trophy
    .icon-trophy
  • truck
    .icon-truck
  • user-plus
    .icon-user-add
  • user-times
    .icon-user-remove
  • twitch
    .icon-twitch
  • sun-o
    .icon-sun
  • sum
    .icon-sum
  • filter
    .icon-filter
  • time
    .icon-time
  • switch
    .icon-switch
  • clear
    .icon-clear
  • lock
    .icon-lock
  • Home, homepage, menu
    .icon-home
  • save
    .icon-save
  • image
    .icon-image
  • txt
    .icon-txt
  • woman
    .icon-woman
  • volume-off
    .icon-volume-off
  • man
    .icon-man
  • share
    .icon-share
  • search
    .icon-search
  • water
    .icon-water
  • msg
    .icon-msg
  • close
    .icon-close
  • delete
    .icon-delete
  • dollar
    .icon-dollar
  • remove
    .icon-remove
  • add
    .icon-add
  • arrows-alt
    .icon-arrow-salt
  • arrow-circle-o-down
    .icon-arrow-circle-down
  • arrow-circle-o-left
    .icon-arrow-circle-left
  • arrow-circle-o-right
    .icon-arrow-circle-right
  • arrow-circle-o-up
    .icon-arrow-circle-up
  • bicycle
    .icon-bicycle
  • binoculars
    .icon-binoculars
  • birthday-cake
    .icon-birthday-cake
  • bomb
    .icon-bomb
  • bus
    .icon-bus
  • cab
    .icon-cab
  • calendar
    .icon-calendar
  • chain
    .icon-chain
  • child
    .icon-child
  • circle
    .icon-circle
  • clipboard
    .icon-clipboard
  • clone
    .icon-clone
  • cloud
    .icon-cloud
  • copyright
    .icon-copy-right
  • coffee
    .icon-coffee
  • eur
    .icon-eur
  • fax
    .icon-fax
  • file-archive-o
    .icon-archive
  • file-text-o
    .icon-text
  • file-word-o
    .icon-word
  • git
    .icon-git
  • meh-o
    .icon-smile
  • minus-circle
    .icon-minuscircle
  • music
    .icon-music
  • question-circle
    .icon-help
  • sitemap
    .icon-sitemap
  • spinner
    .icon-loading
  • upload
    .icon-upload
  • volume-down
    .icon-volume-down
  • volume-up
    .icon-volume-up
  • weibo
    .icon-weibo
  • windows
    .icon-windows
  • wordpress
    .icon-wordpress
  • wrench
    .icon-wrench
  • trash
    .icon-trash
  • thumbs-up
    .icon-thumbs-up
  • th-large
    .icon-large
  • thumbs-down
    .icon-thumbs-down
  • table
    .icon-table
  • apple
    .icon-apple
  • adjust
    .icon-adjust
  • angle-double-down
    .icon-angle-double-down
  • angle-double-left
    .icon-angle-double-left
  • angle-double-right
    .icon-angle-double-right
  • angle-double-up
    .icon-angle-double-up
  • angle-down
    .icon-arrow-down
  • angle-left
    .icon-arrow-left
  • angle-right
    .icon-arrow-right
  • angle-up
    .icon-arrow-up
  • android
    .icon-android
  • arrows
    .icon-arrows
  • arrows-h
    .icon-arrowsh
  • arrows-v
    .icon-arrowsv
  • at
    .icon-at
  • bell
    .icon-bell
  • bell-slash
    .icon-bell-slash
  • backward
    .icon-backward
  • ban
    .icon-ban
  • bank
    .icon-bank
  • bar-chart
    .icon-chart
  • barcode
    .icon-barcode
  • bars
    .icon-bars
  • battery-0
    .icon-battery0
  • battery-1
    .icon-battery1
  • battery-2
    .icon-battery2
  • battery-3
    .icon-battery3
  • battery-4
    .icon-battery4
  • bug
    .icon-bug
  • building
    .icon-building
  • bullhorn
    .icon-bullhorn
  • bullseye
    .icon-bullseye
  • bolt
    .icon-bolt
  • book
    .icon-book
  • caret-down
    .icon-caret-down
  • caret-left
    .icon-caret-left
  • caret-right
    .icon-caret-right
  • caret-up
    .icon-caret-up
  • check
    .icon-check
  • comment
    .icon-comment
  • commenting
    .icon-commenting
  • comments
    .icon-comments
  • cny
    .icon-cny
  • code
    .icon-code
  • css3
    .icon-css3
  • cut
    .icon-cut
  • database
    .icon-database
  • envelope
    .icon-envelope
  • exchange
    .icon-exchange
  • edit
    .icon-edit
  • file-audio-o
    .icon-audio
  • file-excel-o
    .icon-excel
  • file-image-o
    .icon-file-image
  • flag
    .icon-flag
  • folder
    .icon-folder
  • file-movie-o
    .icon-movie
  • file-o
    .icon-file
  • file-pdf-o
    .icon-pdf
  • file-powerpoint-o
    .icon-ppt
  • folder-open
    .icon-folder-open
  • font
    .icon-font
  • hand-peace-o
    .icon-hand-peace
  • heart
    .icon-heart
  • heartbeat
    .icon-heartbeat
  • heart-o
    .icon-heart-blank
  • key
    .icon-key
  • keyboard-o
    .icon-keyboardo
  • info-circle
    .icon-info
  • internet-explorer
    .icon-brower
  • list
    .icon-list
  • mail-forward
    .icon-forward
  • mail-reply
    .icon-back
  • map
    .icon-map
  • map-marker
    .icon-location
  • phone
    .icon-phone
  • play
    .icon-play
  • repeat
    .icon-repeat
  • qq
    .icon-qq
  • qrcode
    .icon-qrcode
  • recycle
    .icon-recycle
  • share-alt
    .icon-sharealt
  • sort
    .icon-sort
  • sort-asc
    .icon-sort-asc
  • sort-desc
    .icon-sort-desc
  • star
    .icon-star
  • star-half-empty
    .icon-star-half
  • star-o
    .icon-star-blank
  • umbrella
    .icon-umbrella
  • unlock
    .icon-unlock
  • wechat
    .icon-wechat
  • wifi
    .icon-wifi

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"。

  • Question
    #icon-question
  • error
    #icon-error
  • 成功-success
    #icon-success
  • row
    #icon-row
  • tab
    #icon-tab
  • 导航
    #icon-daohang
  • One button alarm
    #icon-button
  • form
    #icon-form
  • layout
    #icon-layout
  • csv
    #icon-csv
  • number
    #icon-number
  • 百分比
    #icon-baifenbi
  • date
    #icon-date
  • id-card
    #icon-idcard
  • Select
    #icon-select
  • drop down
    #icon-drop-down
  • drop down-up
    #icon-drop-up
  • icomoon italic
    #icon-italic
  • bold
    #icon-bold
  • 颜色选择器
    #icon-colorSelector
  • underline
    #icon-underline
  • merge-cell
    #icon-merge-cell
  • wrap
    #icon-wrap
  • align-right
    #icon-align-right
  • undo
    #icon-undo
  • redo
    #icon-redo
  • align-left
    #icon-align-left
  • align-center
    #icon-align-center
  • 字体颜色
    #icon-font-colors
  • reduce
    #icon-reduce
  • add
    #icon-expand
  • setting
    #icon-setting
  • stop
    #icon-stop
  • Refresh
    #icon-refresh
  • calculator
    #icon-calculator
  • chrome
    #icon-chrome
  • columns
    #icon-columns
  • desktop
    #icon-desktop
  • diamond
    #icon-diamond
  • frown-o
    #icon-frown
  • tags
    #icon-tags
  • tasks
    #icon-tasks
  • mobile
    #icon-mobile
  • user
    #icon-user
  • ambulance
    #icon-ambulance
  • eye
    #icon-eye
  • magic
    #icon-magic
  • paw
    #icon-paw
  • tree
    #icon-tree
  • trophy
    #icon-trophy
  • truck
    #icon-truck
  • user-plus
    #icon-user-add
  • user-times
    #icon-user-remove
  • twitch
    #icon-twitch
  • sun-o
    #icon-sun
  • sum
    #icon-sum
  • filter
    #icon-filter
  • time
    #icon-time
  • switch
    #icon-switch
  • clear
    #icon-clear
  • lock
    #icon-lock
  • Home, homepage, menu
    #icon-home
  • save
    #icon-save
  • image
    #icon-image
  • txt
    #icon-txt
  • woman
    #icon-woman
  • volume-off
    #icon-volume-off
  • man
    #icon-man
  • share
    #icon-share
  • search
    #icon-search
  • water
    #icon-water
  • msg
    #icon-msg
  • close
    #icon-close
  • delete
    #icon-delete
  • dollar
    #icon-dollar
  • remove
    #icon-remove
  • add
    #icon-add
  • arrows-alt
    #icon-arrow-salt
  • arrow-circle-o-down
    #icon-arrow-circle-down
  • arrow-circle-o-left
    #icon-arrow-circle-left
  • arrow-circle-o-right
    #icon-arrow-circle-right
  • arrow-circle-o-up
    #icon-arrow-circle-up
  • bicycle
    #icon-bicycle
  • binoculars
    #icon-binoculars
  • birthday-cake
    #icon-birthday-cake
  • bomb
    #icon-bomb
  • bus
    #icon-bus
  • cab
    #icon-cab
  • calendar
    #icon-calendar
  • chain
    #icon-chain
  • child
    #icon-child
  • circle
    #icon-circle
  • clipboard
    #icon-clipboard
  • clone
    #icon-clone
  • cloud
    #icon-cloud
  • copyright
    #icon-copy-right
  • coffee
    #icon-coffee
  • eur
    #icon-eur
  • fax
    #icon-fax
  • file-archive-o
    #icon-archive
  • file-text-o
    #icon-text
  • file-word-o
    #icon-word
  • git
    #icon-git
  • meh-o
    #icon-smile
  • minus-circle
    #icon-minuscircle
  • music
    #icon-music
  • question-circle
    #icon-help
  • sitemap
    #icon-sitemap
  • spinner
    #icon-loading
  • upload
    #icon-upload
  • volume-down
    #icon-volume-down
  • volume-up
    #icon-volume-up
  • weibo
    #icon-weibo
  • windows
    #icon-windows
  • wordpress
    #icon-wordpress
  • wrench
    #icon-wrench
  • trash
    #icon-trash
  • thumbs-up
    #icon-thumbs-up
  • th-large
    #icon-large
  • thumbs-down
    #icon-thumbs-down
  • table
    #icon-table
  • apple
    #icon-apple
  • adjust
    #icon-adjust
  • angle-double-down
    #icon-angle-double-down
  • angle-double-left
    #icon-angle-double-left
  • angle-double-right
    #icon-angle-double-right
  • angle-double-up
    #icon-angle-double-up
  • angle-down
    #icon-arrow-down
  • angle-left
    #icon-arrow-left
  • angle-right
    #icon-arrow-right
  • angle-up
    #icon-arrow-up
  • android
    #icon-android
  • arrows
    #icon-arrows
  • arrows-h
    #icon-arrowsh
  • arrows-v
    #icon-arrowsv
  • at
    #icon-at
  • bell
    #icon-bell
  • bell-slash
    #icon-bell-slash
  • backward
    #icon-backward
  • ban
    #icon-ban
  • bank
    #icon-bank
  • bar-chart
    #icon-chart
  • barcode
    #icon-barcode
  • bars
    #icon-bars
  • battery-0
    #icon-battery0
  • battery-1
    #icon-battery1
  • battery-2
    #icon-battery2
  • battery-3
    #icon-battery3
  • battery-4
    #icon-battery4
  • bug
    #icon-bug
  • building
    #icon-building
  • bullhorn
    #icon-bullhorn
  • bullseye
    #icon-bullseye
  • bolt
    #icon-bolt
  • book
    #icon-book
  • caret-down
    #icon-caret-down
  • caret-left
    #icon-caret-left
  • caret-right
    #icon-caret-right
  • caret-up
    #icon-caret-up
  • check
    #icon-check
  • comment
    #icon-comment
  • commenting
    #icon-commenting
  • comments
    #icon-comments
  • cny
    #icon-cny
  • code
    #icon-code
  • css3
    #icon-css3
  • cut
    #icon-cut
  • database
    #icon-database
  • envelope
    #icon-envelope
  • exchange
    #icon-exchange
  • edit
    #icon-edit
  • file-audio-o
    #icon-audio
  • file-excel-o
    #icon-excel
  • file-image-o
    #icon-file-image
  • flag
    #icon-flag
  • folder
    #icon-folder
  • file-movie-o
    #icon-movie
  • file-o
    #icon-file
  • file-pdf-o
    #icon-pdf
  • file-powerpoint-o
    #icon-ppt
  • folder-open
    #icon-folder-open
  • font
    #icon-font
  • hand-peace-o
    #icon-hand-peace
  • heart
    #icon-heart
  • heartbeat
    #icon-heartbeat
  • heart-o
    #icon-heart-blank
  • key
    #icon-key
  • keyboard-o
    #icon-keyboardo
  • info-circle
    #icon-info
  • internet-explorer
    #icon-brower
  • list
    #icon-list
  • mail-forward
    #icon-forward
  • mail-reply
    #icon-back
  • map
    #icon-map
  • map-marker
    #icon-location
  • phone
    #icon-phone
  • play
    #icon-play
  • repeat
    #icon-repeat
  • qq
    #icon-qq
  • qrcode
    #icon-qrcode
  • recycle
    #icon-recycle
  • share-alt
    #icon-sharealt
  • sort
    #icon-sort
  • sort-asc
    #icon-sort-asc
  • sort-desc
    #icon-sort-desc
  • star
    #icon-star
  • star-half-empty
    #icon-star-half
  • star-o
    #icon-star-blank
  • umbrella
    #icon-umbrella
  • unlock
    #icon-unlock
  • wechat
    #icon-wechat
  • wifi
    #icon-wifi

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>