demo_index.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <title>iconfont Demo</title>
  6. <link rel="shortcut icon" href="//img.alicdn.com/imgextra/i2/O1CN01ZyAlrn1MwaMhqz36G_!!6000000001499-73-tps-64-64.ico" type="image/x-icon"/>
  7. <link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01EYTRnJ297D6vehehJ_!!6000000008020-55-tps-64-64.svg"/>
  8. <link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
  9. <link rel="stylesheet" href="demo.css">
  10. <link rel="stylesheet" href="iconfont.css">
  11. <script src="iconfont.js"></script>
  12. <!-- jQuery -->
  13. <script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
  14. <!-- 代码高亮 -->
  15. <script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script>
  16. <style>
  17. .main .logo {
  18. margin-top: 0;
  19. height: auto;
  20. }
  21. .main .logo a {
  22. display: flex;
  23. align-items: center;
  24. }
  25. .main .logo .sub-title {
  26. margin-left: 0.5em;
  27. font-size: 22px;
  28. color: #fff;
  29. background: linear-gradient(-45deg, #3967FF, #B500FE);
  30. -webkit-background-clip: text;
  31. -webkit-text-fill-color: transparent;
  32. }
  33. </style>
  34. </head>
  35. <body>
  36. <div class="main">
  37. <h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">
  38. <img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01Mn65HV1FfSEzR6DKv_!!6000000000514-55-tps-228-59.svg">
  39. </a></h1>
  40. <div class="nav-tabs">
  41. <ul id="tabs" class="dib-box">
  42. <li class="dib active"><span>Unicode</span></li>
  43. <li class="dib"><span>Font class</span></li>
  44. <li class="dib"><span>Symbol</span></li>
  45. </ul>
  46. </div>
  47. <div class="tab-container">
  48. <div class="content unicode" style="display: block;">
  49. <ul class="icon_lists dib-box">
  50. <li class="dib">
  51. <span class="icon iconfont">&#xe668;</span>
  52. <div class="name">分类</div>
  53. <div class="code-name">&amp;#xe668;</div>
  54. </li>
  55. <li class="dib">
  56. <span class="icon iconfont">&#xe669;</span>
  57. <div class="name">安全</div>
  58. <div class="code-name">&amp;#xe669;</div>
  59. </li>
  60. <li class="dib">
  61. <span class="icon iconfont">&#xe66a;</span>
  62. <div class="name">付款</div>
  63. <div class="code-name">&amp;#xe66a;</div>
  64. </li>
  65. <li class="dib">
  66. <span class="icon iconfont">&#xe66b;</span>
  67. <div class="name">购物车</div>
  68. <div class="code-name">&amp;#xe66b;</div>
  69. </li>
  70. <li class="dib">
  71. <span class="icon iconfont">&#xe66c;</span>
  72. <div class="name">解锁</div>
  73. <div class="code-name">&amp;#xe66c;</div>
  74. </li>
  75. <li class="dib">
  76. <span class="icon iconfont">&#xe66d;</span>
  77. <div class="name">下载</div>
  78. <div class="code-name">&amp;#xe66d;</div>
  79. </li>
  80. <li class="dib">
  81. <span class="icon iconfont">&#xe66e;</span>
  82. <div class="name">信用卡</div>
  83. <div class="code-name">&amp;#xe66e;</div>
  84. </li>
  85. <li class="dib">
  86. <span class="icon iconfont">&#xe66f;</span>
  87. <div class="name">分享</div>
  88. <div class="code-name">&amp;#xe66f;</div>
  89. </li>
  90. <li class="dib">
  91. <span class="icon iconfont">&#xe670;</span>
  92. <div class="name">信息</div>
  93. <div class="code-name">&amp;#xe670;</div>
  94. </li>
  95. <li class="dib">
  96. <span class="icon iconfont">&#xe671;</span>
  97. <div class="name">扫描</div>
  98. <div class="code-name">&amp;#xe671;</div>
  99. </li>
  100. <li class="dib">
  101. <span class="icon iconfont">&#xe672;</span>
  102. <div class="name">设置</div>
  103. <div class="code-name">&amp;#xe672;</div>
  104. </li>
  105. <li class="dib">
  106. <span class="icon iconfont">&#xe673;</span>
  107. <div class="name">疑问</div>
  108. <div class="code-name">&amp;#xe673;</div>
  109. </li>
  110. <li class="dib">
  111. <span class="icon iconfont">&#xe674;</span>
  112. <div class="name">选项</div>
  113. <div class="code-name">&amp;#xe674;</div>
  114. </li>
  115. <li class="dib">
  116. <span class="icon iconfont">&#xe675;</span>
  117. <div class="name">我的</div>
  118. <div class="code-name">&amp;#xe675;</div>
  119. </li>
  120. <li class="dib">
  121. <span class="icon iconfont">&#xe676;</span>
  122. <div class="name">搜索</div>
  123. <div class="code-name">&amp;#xe676;</div>
  124. </li>
  125. <li class="dib">
  126. <span class="icon iconfont">&#xe677;</span>
  127. <div class="name">消息</div>
  128. <div class="code-name">&amp;#xe677;</div>
  129. </li>
  130. <li class="dib">
  131. <span class="icon iconfont">&#xe678;</span>
  132. <div class="name">删除</div>
  133. <div class="code-name">&amp;#xe678;</div>
  134. </li>
  135. <li class="dib">
  136. <span class="icon iconfont">&#xe679;</span>
  137. <div class="name">首页</div>
  138. <div class="code-name">&amp;#xe679;</div>
  139. </li>
  140. <li class="dib">
  141. <span class="icon iconfont">&#xe67a;</span>
  142. <div class="name">上传</div>
  143. <div class="code-name">&amp;#xe67a;</div>
  144. </li>
  145. <li class="dib">
  146. <span class="icon iconfont">&#xe604;</span>
  147. <div class="name">认证</div>
  148. <div class="code-name">&amp;#xe604;</div>
  149. </li>
  150. <li class="dib">
  151. <span class="icon iconfont">&#xe605;</span>
  152. <div class="name">家</div>
  153. <div class="code-name">&amp;#xe605;</div>
  154. </li>
  155. <li class="dib">
  156. <span class="icon iconfont">&#xe606;</span>
  157. <div class="name">证件</div>
  158. <div class="code-name">&amp;#xe606;</div>
  159. </li>
  160. <li class="dib">
  161. <span class="icon iconfont">&#xe607;</span>
  162. <div class="name">土地</div>
  163. <div class="code-name">&amp;#xe607;</div>
  164. </li>
  165. <li class="dib">
  166. <span class="icon iconfont">&#xe608;</span>
  167. <div class="name">团队</div>
  168. <div class="code-name">&amp;#xe608;</div>
  169. </li>
  170. <li class="dib">
  171. <span class="icon iconfont">&#xe609;</span>
  172. <div class="name">书籍</div>
  173. <div class="code-name">&amp;#xe609;</div>
  174. </li>
  175. <li class="dib">
  176. <span class="icon iconfont">&#xe60a;</span>
  177. <div class="name">安全</div>
  178. <div class="code-name">&amp;#xe60a;</div>
  179. </li>
  180. <li class="dib">
  181. <span class="icon iconfont">&#xe60b;</span>
  182. <div class="name">注销</div>
  183. <div class="code-name">&amp;#xe60b;</div>
  184. </li>
  185. <li class="dib">
  186. <span class="icon iconfont">&#xe60c;</span>
  187. <div class="name">资源</div>
  188. <div class="code-name">&amp;#xe60c;</div>
  189. </li>
  190. <li class="dib">
  191. <span class="icon iconfont">&#xe60d;</span>
  192. <div class="name">服务</div>
  193. <div class="code-name">&amp;#xe60d;</div>
  194. </li>
  195. <li class="dib">
  196. <span class="icon iconfont">&#xe60e;</span>
  197. <div class="name">营业执照</div>
  198. <div class="code-name">&amp;#xe60e;</div>
  199. </li>
  200. <li class="dib">
  201. <span class="icon iconfont">&#xe60f;</span>
  202. <div class="name">机械</div>
  203. <div class="code-name">&amp;#xe60f;</div>
  204. </li>
  205. </ul>
  206. <div class="article markdown">
  207. <h2 id="unicode-">Unicode 引用</h2>
  208. <hr>
  209. <p>Unicode 是字体在网页端最原始的应用方式,特点是:</p>
  210. <ul>
  211. <li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
  212. <li>默认情况下不支持多色,直接添加多色图标会自动去色。</li>
  213. </ul>
  214. <blockquote>
  215. <p>注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)</p>
  216. </blockquote>
  217. <p>Unicode 使用步骤如下:</p>
  218. <h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
  219. <pre><code class="language-css"
  220. >@font-face {
  221. font-family: 'iconfont';
  222. src: url('iconfont.ttf?t=1629381236134') format('truetype');
  223. }
  224. </code></pre>
  225. <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
  226. <pre><code class="language-css"
  227. >.iconfont {
  228. font-family: "iconfont" !important;
  229. font-size: 16px;
  230. font-style: normal;
  231. -webkit-font-smoothing: antialiased;
  232. -moz-osx-font-smoothing: grayscale;
  233. }
  234. </code></pre>
  235. <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
  236. <pre>
  237. <code class="language-html"
  238. >&lt;span class="iconfont"&gt;&amp;#x33;&lt;/span&gt;
  239. </code></pre>
  240. <blockquote>
  241. <p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
  242. </blockquote>
  243. </div>
  244. </div>
  245. <div class="content font-class">
  246. <ul class="icon_lists dib-box">
  247. <li class="dib">
  248. <span class="icon iconfont icon-fenlei"></span>
  249. <div class="name">
  250. 分类
  251. </div>
  252. <div class="code-name">.icon-fenlei
  253. </div>
  254. </li>
  255. <li class="dib">
  256. <span class="icon iconfont icon-anquan"></span>
  257. <div class="name">
  258. 安全
  259. </div>
  260. <div class="code-name">.icon-anquan
  261. </div>
  262. </li>
  263. <li class="dib">
  264. <span class="icon iconfont icon-fukuan"></span>
  265. <div class="name">
  266. 付款
  267. </div>
  268. <div class="code-name">.icon-fukuan
  269. </div>
  270. </li>
  271. <li class="dib">
  272. <span class="icon iconfont icon-gouwuche"></span>
  273. <div class="name">
  274. 购物车
  275. </div>
  276. <div class="code-name">.icon-gouwuche
  277. </div>
  278. </li>
  279. <li class="dib">
  280. <span class="icon iconfont icon-jiesuo"></span>
  281. <div class="name">
  282. 解锁
  283. </div>
  284. <div class="code-name">.icon-jiesuo
  285. </div>
  286. </li>
  287. <li class="dib">
  288. <span class="icon iconfont icon-xiazai"></span>
  289. <div class="name">
  290. 下载
  291. </div>
  292. <div class="code-name">.icon-xiazai
  293. </div>
  294. </li>
  295. <li class="dib">
  296. <span class="icon iconfont icon-xinyongka"></span>
  297. <div class="name">
  298. 信用卡
  299. </div>
  300. <div class="code-name">.icon-xinyongka
  301. </div>
  302. </li>
  303. <li class="dib">
  304. <span class="icon iconfont icon-fenxiang"></span>
  305. <div class="name">
  306. 分享
  307. </div>
  308. <div class="code-name">.icon-fenxiang
  309. </div>
  310. </li>
  311. <li class="dib">
  312. <span class="icon iconfont icon-xinxi"></span>
  313. <div class="name">
  314. 信息
  315. </div>
  316. <div class="code-name">.icon-xinxi
  317. </div>
  318. </li>
  319. <li class="dib">
  320. <span class="icon iconfont icon-saomiao"></span>
  321. <div class="name">
  322. 扫描
  323. </div>
  324. <div class="code-name">.icon-saomiao
  325. </div>
  326. </li>
  327. <li class="dib">
  328. <span class="icon iconfont icon-shezhi"></span>
  329. <div class="name">
  330. 设置
  331. </div>
  332. <div class="code-name">.icon-shezhi
  333. </div>
  334. </li>
  335. <li class="dib">
  336. <span class="icon iconfont icon-yiwen"></span>
  337. <div class="name">
  338. 疑问
  339. </div>
  340. <div class="code-name">.icon-yiwen
  341. </div>
  342. </li>
  343. <li class="dib">
  344. <span class="icon iconfont icon-xuanxiang"></span>
  345. <div class="name">
  346. 选项
  347. </div>
  348. <div class="code-name">.icon-xuanxiang
  349. </div>
  350. </li>
  351. <li class="dib">
  352. <span class="icon iconfont icon-wode"></span>
  353. <div class="name">
  354. 我的
  355. </div>
  356. <div class="code-name">.icon-wode
  357. </div>
  358. </li>
  359. <li class="dib">
  360. <span class="icon iconfont icon-sousuo"></span>
  361. <div class="name">
  362. 搜索
  363. </div>
  364. <div class="code-name">.icon-sousuo
  365. </div>
  366. </li>
  367. <li class="dib">
  368. <span class="icon iconfont icon-xiaoxi"></span>
  369. <div class="name">
  370. 消息
  371. </div>
  372. <div class="code-name">.icon-xiaoxi
  373. </div>
  374. </li>
  375. <li class="dib">
  376. <span class="icon iconfont icon-shanchu"></span>
  377. <div class="name">
  378. 删除
  379. </div>
  380. <div class="code-name">.icon-shanchu
  381. </div>
  382. </li>
  383. <li class="dib">
  384. <span class="icon iconfont icon-shouye"></span>
  385. <div class="name">
  386. 首页
  387. </div>
  388. <div class="code-name">.icon-shouye
  389. </div>
  390. </li>
  391. <li class="dib">
  392. <span class="icon iconfont icon-shangchuan"></span>
  393. <div class="name">
  394. 上传
  395. </div>
  396. <div class="code-name">.icon-shangchuan
  397. </div>
  398. </li>
  399. <li class="dib">
  400. <span class="icon iconfont icon-ziyuan5"></span>
  401. <div class="name">
  402. 认证
  403. </div>
  404. <div class="code-name">.icon-ziyuan5
  405. </div>
  406. </li>
  407. <li class="dib">
  408. <span class="icon iconfont icon-ziyuan26"></span>
  409. <div class="name">
  410. </div>
  411. <div class="code-name">.icon-ziyuan26
  412. </div>
  413. </li>
  414. <li class="dib">
  415. <span class="icon iconfont icon-ziyuan27"></span>
  416. <div class="name">
  417. 证件
  418. </div>
  419. <div class="code-name">.icon-ziyuan27
  420. </div>
  421. </li>
  422. <li class="dib">
  423. <span class="icon iconfont icon-ziyuan1"></span>
  424. <div class="name">
  425. 土地
  426. </div>
  427. <div class="code-name">.icon-ziyuan1
  428. </div>
  429. </li>
  430. <li class="dib">
  431. <span class="icon iconfont icon-ziyuan4"></span>
  432. <div class="name">
  433. 团队
  434. </div>
  435. <div class="code-name">.icon-ziyuan4
  436. </div>
  437. </li>
  438. <li class="dib">
  439. <span class="icon iconfont icon-ziyuan12"></span>
  440. <div class="name">
  441. 书籍
  442. </div>
  443. <div class="code-name">.icon-ziyuan12
  444. </div>
  445. </li>
  446. <li class="dib">
  447. <span class="icon iconfont icon-ziyuan22"></span>
  448. <div class="name">
  449. 安全
  450. </div>
  451. <div class="code-name">.icon-ziyuan22
  452. </div>
  453. </li>
  454. <li class="dib">
  455. <span class="icon iconfont icon-ziyuan2"></span>
  456. <div class="name">
  457. 注销
  458. </div>
  459. <div class="code-name">.icon-ziyuan2
  460. </div>
  461. </li>
  462. <li class="dib">
  463. <span class="icon iconfont icon-ziyuan24"></span>
  464. <div class="name">
  465. 资源
  466. </div>
  467. <div class="code-name">.icon-ziyuan24
  468. </div>
  469. </li>
  470. <li class="dib">
  471. <span class="icon iconfont icon-ziyuan8"></span>
  472. <div class="name">
  473. 服务
  474. </div>
  475. <div class="code-name">.icon-ziyuan8
  476. </div>
  477. </li>
  478. <li class="dib">
  479. <span class="icon iconfont icon-ziyuan16"></span>
  480. <div class="name">
  481. 营业执照
  482. </div>
  483. <div class="code-name">.icon-ziyuan16
  484. </div>
  485. </li>
  486. <li class="dib">
  487. <span class="icon iconfont icon-ziyuan14"></span>
  488. <div class="name">
  489. 机械
  490. </div>
  491. <div class="code-name">.icon-ziyuan14
  492. </div>
  493. </li>
  494. </ul>
  495. <div class="article markdown">
  496. <h2 id="font-class-">font-class 引用</h2>
  497. <hr>
  498. <p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p>
  499. <p>与 Unicode 使用方式相比,具有如下特点:</p>
  500. <ul>
  501. <li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li>
  502. <li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li>
  503. </ul>
  504. <p>使用步骤如下:</p>
  505. <h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
  506. <pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt;
  507. </code></pre>
  508. <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
  509. <pre><code class="language-html">&lt;span class="iconfont icon-xxx"&gt;&lt;/span&gt;
  510. </code></pre>
  511. <blockquote>
  512. <p>"
  513. iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
  514. </blockquote>
  515. </div>
  516. </div>
  517. <div class="content symbol">
  518. <ul class="icon_lists dib-box">
  519. <li class="dib">
  520. <svg class="icon svg-icon" aria-hidden="true">
  521. <use xlink:href="#icon-fenlei"></use>
  522. </svg>
  523. <div class="name">分类</div>
  524. <div class="code-name">#icon-fenlei</div>
  525. </li>
  526. <li class="dib">
  527. <svg class="icon svg-icon" aria-hidden="true">
  528. <use xlink:href="#icon-anquan"></use>
  529. </svg>
  530. <div class="name">安全</div>
  531. <div class="code-name">#icon-anquan</div>
  532. </li>
  533. <li class="dib">
  534. <svg class="icon svg-icon" aria-hidden="true">
  535. <use xlink:href="#icon-fukuan"></use>
  536. </svg>
  537. <div class="name">付款</div>
  538. <div class="code-name">#icon-fukuan</div>
  539. </li>
  540. <li class="dib">
  541. <svg class="icon svg-icon" aria-hidden="true">
  542. <use xlink:href="#icon-gouwuche"></use>
  543. </svg>
  544. <div class="name">购物车</div>
  545. <div class="code-name">#icon-gouwuche</div>
  546. </li>
  547. <li class="dib">
  548. <svg class="icon svg-icon" aria-hidden="true">
  549. <use xlink:href="#icon-jiesuo"></use>
  550. </svg>
  551. <div class="name">解锁</div>
  552. <div class="code-name">#icon-jiesuo</div>
  553. </li>
  554. <li class="dib">
  555. <svg class="icon svg-icon" aria-hidden="true">
  556. <use xlink:href="#icon-xiazai"></use>
  557. </svg>
  558. <div class="name">下载</div>
  559. <div class="code-name">#icon-xiazai</div>
  560. </li>
  561. <li class="dib">
  562. <svg class="icon svg-icon" aria-hidden="true">
  563. <use xlink:href="#icon-xinyongka"></use>
  564. </svg>
  565. <div class="name">信用卡</div>
  566. <div class="code-name">#icon-xinyongka</div>
  567. </li>
  568. <li class="dib">
  569. <svg class="icon svg-icon" aria-hidden="true">
  570. <use xlink:href="#icon-fenxiang"></use>
  571. </svg>
  572. <div class="name">分享</div>
  573. <div class="code-name">#icon-fenxiang</div>
  574. </li>
  575. <li class="dib">
  576. <svg class="icon svg-icon" aria-hidden="true">
  577. <use xlink:href="#icon-xinxi"></use>
  578. </svg>
  579. <div class="name">信息</div>
  580. <div class="code-name">#icon-xinxi</div>
  581. </li>
  582. <li class="dib">
  583. <svg class="icon svg-icon" aria-hidden="true">
  584. <use xlink:href="#icon-saomiao"></use>
  585. </svg>
  586. <div class="name">扫描</div>
  587. <div class="code-name">#icon-saomiao</div>
  588. </li>
  589. <li class="dib">
  590. <svg class="icon svg-icon" aria-hidden="true">
  591. <use xlink:href="#icon-shezhi"></use>
  592. </svg>
  593. <div class="name">设置</div>
  594. <div class="code-name">#icon-shezhi</div>
  595. </li>
  596. <li class="dib">
  597. <svg class="icon svg-icon" aria-hidden="true">
  598. <use xlink:href="#icon-yiwen"></use>
  599. </svg>
  600. <div class="name">疑问</div>
  601. <div class="code-name">#icon-yiwen</div>
  602. </li>
  603. <li class="dib">
  604. <svg class="icon svg-icon" aria-hidden="true">
  605. <use xlink:href="#icon-xuanxiang"></use>
  606. </svg>
  607. <div class="name">选项</div>
  608. <div class="code-name">#icon-xuanxiang</div>
  609. </li>
  610. <li class="dib">
  611. <svg class="icon svg-icon" aria-hidden="true">
  612. <use xlink:href="#icon-wode"></use>
  613. </svg>
  614. <div class="name">我的</div>
  615. <div class="code-name">#icon-wode</div>
  616. </li>
  617. <li class="dib">
  618. <svg class="icon svg-icon" aria-hidden="true">
  619. <use xlink:href="#icon-sousuo"></use>
  620. </svg>
  621. <div class="name">搜索</div>
  622. <div class="code-name">#icon-sousuo</div>
  623. </li>
  624. <li class="dib">
  625. <svg class="icon svg-icon" aria-hidden="true">
  626. <use xlink:href="#icon-xiaoxi"></use>
  627. </svg>
  628. <div class="name">消息</div>
  629. <div class="code-name">#icon-xiaoxi</div>
  630. </li>
  631. <li class="dib">
  632. <svg class="icon svg-icon" aria-hidden="true">
  633. <use xlink:href="#icon-shanchu"></use>
  634. </svg>
  635. <div class="name">删除</div>
  636. <div class="code-name">#icon-shanchu</div>
  637. </li>
  638. <li class="dib">
  639. <svg class="icon svg-icon" aria-hidden="true">
  640. <use xlink:href="#icon-shouye"></use>
  641. </svg>
  642. <div class="name">首页</div>
  643. <div class="code-name">#icon-shouye</div>
  644. </li>
  645. <li class="dib">
  646. <svg class="icon svg-icon" aria-hidden="true">
  647. <use xlink:href="#icon-shangchuan"></use>
  648. </svg>
  649. <div class="name">上传</div>
  650. <div class="code-name">#icon-shangchuan</div>
  651. </li>
  652. <li class="dib">
  653. <svg class="icon svg-icon" aria-hidden="true">
  654. <use xlink:href="#icon-ziyuan5"></use>
  655. </svg>
  656. <div class="name">认证</div>
  657. <div class="code-name">#icon-ziyuan5</div>
  658. </li>
  659. <li class="dib">
  660. <svg class="icon svg-icon" aria-hidden="true">
  661. <use xlink:href="#icon-ziyuan26"></use>
  662. </svg>
  663. <div class="name">家</div>
  664. <div class="code-name">#icon-ziyuan26</div>
  665. </li>
  666. <li class="dib">
  667. <svg class="icon svg-icon" aria-hidden="true">
  668. <use xlink:href="#icon-ziyuan27"></use>
  669. </svg>
  670. <div class="name">证件</div>
  671. <div class="code-name">#icon-ziyuan27</div>
  672. </li>
  673. <li class="dib">
  674. <svg class="icon svg-icon" aria-hidden="true">
  675. <use xlink:href="#icon-ziyuan1"></use>
  676. </svg>
  677. <div class="name">土地</div>
  678. <div class="code-name">#icon-ziyuan1</div>
  679. </li>
  680. <li class="dib">
  681. <svg class="icon svg-icon" aria-hidden="true">
  682. <use xlink:href="#icon-ziyuan4"></use>
  683. </svg>
  684. <div class="name">团队</div>
  685. <div class="code-name">#icon-ziyuan4</div>
  686. </li>
  687. <li class="dib">
  688. <svg class="icon svg-icon" aria-hidden="true">
  689. <use xlink:href="#icon-ziyuan12"></use>
  690. </svg>
  691. <div class="name">书籍</div>
  692. <div class="code-name">#icon-ziyuan12</div>
  693. </li>
  694. <li class="dib">
  695. <svg class="icon svg-icon" aria-hidden="true">
  696. <use xlink:href="#icon-ziyuan22"></use>
  697. </svg>
  698. <div class="name">安全</div>
  699. <div class="code-name">#icon-ziyuan22</div>
  700. </li>
  701. <li class="dib">
  702. <svg class="icon svg-icon" aria-hidden="true">
  703. <use xlink:href="#icon-ziyuan2"></use>
  704. </svg>
  705. <div class="name">注销</div>
  706. <div class="code-name">#icon-ziyuan2</div>
  707. </li>
  708. <li class="dib">
  709. <svg class="icon svg-icon" aria-hidden="true">
  710. <use xlink:href="#icon-ziyuan24"></use>
  711. </svg>
  712. <div class="name">资源</div>
  713. <div class="code-name">#icon-ziyuan24</div>
  714. </li>
  715. <li class="dib">
  716. <svg class="icon svg-icon" aria-hidden="true">
  717. <use xlink:href="#icon-ziyuan8"></use>
  718. </svg>
  719. <div class="name">服务</div>
  720. <div class="code-name">#icon-ziyuan8</div>
  721. </li>
  722. <li class="dib">
  723. <svg class="icon svg-icon" aria-hidden="true">
  724. <use xlink:href="#icon-ziyuan16"></use>
  725. </svg>
  726. <div class="name">营业执照</div>
  727. <div class="code-name">#icon-ziyuan16</div>
  728. </li>
  729. <li class="dib">
  730. <svg class="icon svg-icon" aria-hidden="true">
  731. <use xlink:href="#icon-ziyuan14"></use>
  732. </svg>
  733. <div class="name">机械</div>
  734. <div class="code-name">#icon-ziyuan14</div>
  735. </li>
  736. </ul>
  737. <div class="article markdown">
  738. <h2 id="symbol-">Symbol 引用</h2>
  739. <hr>
  740. <p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
  741. 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p>
  742. <ul>
  743. <li>支持多色图标了,不再受单色限制。</li>
  744. <li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li>
  745. <li>兼容性较差,支持 IE9+,及现代浏览器。</li>
  746. <li>浏览器渲染 SVG 的性能一般,还不如 png。</li>
  747. </ul>
  748. <p>使用步骤如下:</p>
  749. <h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
  750. <pre><code class="language-html">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;
  751. </code></pre>
  752. <h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
  753. <pre><code class="language-html">&lt;style&gt;
  754. .icon {
  755. width: 1em;
  756. height: 1em;
  757. vertical-align: -0.15em;
  758. fill: currentColor;
  759. overflow: hidden;
  760. }
  761. &lt;/style&gt;
  762. </code></pre>
  763. <h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
  764. <pre><code class="language-html">&lt;svg class="icon" aria-hidden="true"&gt;
  765. &lt;use xlink:href="#icon-xxx"&gt;&lt;/use&gt;
  766. &lt;/svg&gt;
  767. </code></pre>
  768. </div>
  769. </div>
  770. </div>
  771. </div>
  772. <script>
  773. $(document).ready(function () {
  774. $('.tab-container .content:first').show()
  775. $('#tabs li').click(function (e) {
  776. var tabContent = $('.tab-container .content')
  777. var index = $(this).index()
  778. if ($(this).hasClass('active')) {
  779. return
  780. } else {
  781. $('#tabs li').removeClass('active')
  782. $(this).addClass('active')
  783. tabContent.hide().eq(index).fadeIn()
  784. }
  785. })
  786. })
  787. </script>
  788. </body>
  789. </html>