demo_index.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <title>IconFont Demo</title>
  6. <link rel="shortcut icon" href="https://img.alicdn.com/tps/i4/TB1_oz6GVXXXXaFXpXXJDFnIXXX-64-64.ico" type="image/x-icon"/>
  7. <link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
  8. <link rel="stylesheet" href="demo.css">
  9. <link rel="stylesheet" href="iconfont.css">
  10. <script src="iconfont.js"></script>
  11. <!-- jQuery -->
  12. <script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
  13. <!-- 代码高亮 -->
  14. <script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script>
  15. </head>
  16. <body>
  17. <div class="main">
  18. <h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">&#xe86b;</a></h1>
  19. <div class="nav-tabs">
  20. <ul id="tabs" class="dib-box">
  21. <li class="dib active"><span>Unicode</span></li>
  22. <li class="dib"><span>Font class</span></li>
  23. <li class="dib"><span>Symbol</span></li>
  24. </ul>
  25. <a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=2039516" target="_blank" class="nav-more">查看项目</a>
  26. </div>
  27. <div class="tab-container">
  28. <div class="content unicode" style="display: block;">
  29. <ul class="icon_lists dib-box">
  30. <li class="dib">
  31. <span class="icon iconfont">&#xe63d;</span>
  32. <div class="name">后退</div>
  33. <div class="code-name">&amp;#xe63d;</div>
  34. </li>
  35. <li class="dib">
  36. <span class="icon iconfont">&#xe662;</span>
  37. <div class="name">加</div>
  38. <div class="code-name">&amp;#xe662;</div>
  39. </li>
  40. <li class="dib">
  41. <span class="icon iconfont">&#xe663;</span>
  42. <div class="name">减</div>
  43. <div class="code-name">&amp;#xe663;</div>
  44. </li>
  45. <li class="dib">
  46. <span class="icon iconfont">&#xe65f;</span>
  47. <div class="name">地质</div>
  48. <div class="code-name">&amp;#xe65f;</div>
  49. </li>
  50. <li class="dib">
  51. <span class="icon iconfont">&#xe660;</span>
  52. <div class="name">风云榜</div>
  53. <div class="code-name">&amp;#xe660;</div>
  54. </li>
  55. <li class="dib">
  56. <span class="icon iconfont">&#xe661;</span>
  57. <div class="name">更多</div>
  58. <div class="code-name">&amp;#xe661;</div>
  59. </li>
  60. <li class="dib">
  61. <span class="icon iconfont">&#xe65e;</span>
  62. <div class="name">保(3)</div>
  63. <div class="code-name">&amp;#xe65e;</div>
  64. </li>
  65. <li class="dib">
  66. <span class="icon iconfont">&#xe65d;</span>
  67. <div class="name">企业认证</div>
  68. <div class="code-name">&amp;#xe65d;</div>
  69. </li>
  70. <li class="dib">
  71. <span class="icon iconfont">&#xe65c;</span>
  72. <div class="name">加号</div>
  73. <div class="code-name">&amp;#xe65c;</div>
  74. </li>
  75. <li class="dib">
  76. <span class="icon iconfont">&#xe65b;</span>
  77. <div class="name">我的订单</div>
  78. <div class="code-name">&amp;#xe65b;</div>
  79. </li>
  80. <li class="dib">
  81. <span class="icon iconfont">&#xe65a;</span>
  82. <div class="name">Group</div>
  83. <div class="code-name">&amp;#xe65a;</div>
  84. </li>
  85. <li class="dib">
  86. <span class="icon iconfont">&#xe659;</span>
  87. <div class="name">帮助</div>
  88. <div class="code-name">&amp;#xe659;</div>
  89. </li>
  90. <li class="dib">
  91. <span class="icon iconfont">&#xe658;</span>
  92. <div class="name">电话</div>
  93. <div class="code-name">&amp;#xe658;</div>
  94. </li>
  95. <li class="dib">
  96. <span class="icon iconfont">&#xe657;</span>
  97. <div class="name">商品</div>
  98. <div class="code-name">&amp;#xe657;</div>
  99. </li>
  100. <li class="dib">
  101. <span class="icon iconfont">&#xe654;</span>
  102. <div class="name">采购</div>
  103. <div class="code-name">&amp;#xe654;</div>
  104. </li>
  105. <li class="dib">
  106. <span class="icon iconfont">&#xe655;</span>
  107. <div class="name">地址</div>
  108. <div class="code-name">&amp;#xe655;</div>
  109. </li>
  110. <li class="dib">
  111. <span class="icon iconfont">&#xe656;</span>
  112. <div class="name">找代卖</div>
  113. <div class="code-name">&amp;#xe656;</div>
  114. </li>
  115. <li class="dib">
  116. <span class="icon iconfont">&#xe653;</span>
  117. <div class="name">Group 2</div>
  118. <div class="code-name">&amp;#xe653;</div>
  119. </li>
  120. <li class="dib">
  121. <span class="icon iconfont">&#xe64e;</span>
  122. <div class="name">发布1</div>
  123. <div class="code-name">&amp;#xe64e;</div>
  124. </li>
  125. <li class="dib">
  126. <span class="icon iconfont">&#xe650;</span>
  127. <div class="name">home</div>
  128. <div class="code-name">&amp;#xe650;</div>
  129. </li>
  130. <li class="dib">
  131. <span class="icon iconfont">&#xe651;</span>
  132. <div class="name">我的1</div>
  133. <div class="code-name">&amp;#xe651;</div>
  134. </li>
  135. <li class="dib">
  136. <span class="icon iconfont">&#xe652;</span>
  137. <div class="name">我的2</div>
  138. <div class="code-name">&amp;#xe652;</div>
  139. </li>
  140. <li class="dib">
  141. <span class="icon iconfont">&#xe64c;</span>
  142. <div class="name">发布2</div>
  143. <div class="code-name">&amp;#xe64c;</div>
  144. </li>
  145. <li class="dib">
  146. <span class="icon iconfont">&#xe64d;</span>
  147. <div class="name">home2</div>
  148. <div class="code-name">&amp;#xe64d;</div>
  149. </li>
  150. </ul>
  151. <div class="article markdown">
  152. <h2 id="unicode-">Unicode 引用</h2>
  153. <hr>
  154. <p>Unicode 是字体在网页端最原始的应用方式,特点是:</p>
  155. <ul>
  156. <li>兼容性最好,支持 IE6+,及所有现代浏览器。</li>
  157. <li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
  158. <li>但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。</li>
  159. </ul>
  160. <blockquote>
  161. <p>注意:新版 iconfont 支持多色图标,这些多色图标在 Unicode 模式下将不能使用,如果有需求建议使用symbol 的引用方式</p>
  162. </blockquote>
  163. <p>Unicode 使用步骤如下:</p>
  164. <h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
  165. <pre><code class="language-css"
  166. >@font-face {
  167. font-family: 'iconfont';
  168. src: url('iconfont.eot');
  169. src: url('iconfont.eot?#iefix') format('embedded-opentype'),
  170. url('iconfont.woff2') format('woff2'),
  171. url('iconfont.woff') format('woff'),
  172. url('iconfont.ttf') format('truetype'),
  173. url('iconfont.svg#iconfont') format('svg');
  174. }
  175. </code></pre>
  176. <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
  177. <pre><code class="language-css"
  178. >.iconfont {
  179. font-family: "iconfont" !important;
  180. font-size: 16px;
  181. font-style: normal;
  182. -webkit-font-smoothing: antialiased;
  183. -moz-osx-font-smoothing: grayscale;
  184. }
  185. </code></pre>
  186. <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
  187. <pre>
  188. <code class="language-html"
  189. >&lt;span class="iconfont"&gt;&amp;#x33;&lt;/span&gt;
  190. </code></pre>
  191. <blockquote>
  192. <p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
  193. </blockquote>
  194. </div>
  195. </div>
  196. <div class="content font-class">
  197. <ul class="icon_lists dib-box">
  198. <li class="dib">
  199. <span class="icon iconfont iconhoutui"></span>
  200. <div class="name">
  201. 后退
  202. </div>
  203. <div class="code-name">.iconhoutui
  204. </div>
  205. </li>
  206. <li class="dib">
  207. <span class="icon iconfont iconjia"></span>
  208. <div class="name">
  209. </div>
  210. <div class="code-name">.iconjia
  211. </div>
  212. </li>
  213. <li class="dib">
  214. <span class="icon iconfont iconjian"></span>
  215. <div class="name">
  216. </div>
  217. <div class="code-name">.iconjian
  218. </div>
  219. </li>
  220. <li class="dib">
  221. <span class="icon iconfont icondizhi1"></span>
  222. <div class="name">
  223. 地质
  224. </div>
  225. <div class="code-name">.icondizhi1
  226. </div>
  227. </li>
  228. <li class="dib">
  229. <span class="icon iconfont iconfengyunbang"></span>
  230. <div class="name">
  231. 风云榜
  232. </div>
  233. <div class="code-name">.iconfengyunbang
  234. </div>
  235. </li>
  236. <li class="dib">
  237. <span class="icon iconfont icongengduo"></span>
  238. <div class="name">
  239. 更多
  240. </div>
  241. <div class="code-name">.icongengduo
  242. </div>
  243. </li>
  244. <li class="dib">
  245. <span class="icon iconfont iconbao3"></span>
  246. <div class="name">
  247. 保(3)
  248. </div>
  249. <div class="code-name">.iconbao3
  250. </div>
  251. </li>
  252. <li class="dib">
  253. <span class="icon iconfont iconwodetuandui"></span>
  254. <div class="name">
  255. 企业认证
  256. </div>
  257. <div class="code-name">.iconwodetuandui
  258. </div>
  259. </li>
  260. <li class="dib">
  261. <span class="icon iconfont iconjiahao"></span>
  262. <div class="name">
  263. 加号
  264. </div>
  265. <div class="code-name">.iconjiahao
  266. </div>
  267. </li>
  268. <li class="dib">
  269. <span class="icon iconfont iconwodedingdan"></span>
  270. <div class="name">
  271. 我的订单
  272. </div>
  273. <div class="code-name">.iconwodedingdan
  274. </div>
  275. </li>
  276. <li class="dib">
  277. <span class="icon iconfont iconGroup"></span>
  278. <div class="name">
  279. Group
  280. </div>
  281. <div class="code-name">.iconGroup
  282. </div>
  283. </li>
  284. <li class="dib">
  285. <span class="icon iconfont iconbangzhu"></span>
  286. <div class="name">
  287. 帮助
  288. </div>
  289. <div class="code-name">.iconbangzhu
  290. </div>
  291. </li>
  292. <li class="dib">
  293. <span class="icon iconfont icondianhua"></span>
  294. <div class="name">
  295. 电话
  296. </div>
  297. <div class="code-name">.icondianhua
  298. </div>
  299. </li>
  300. <li class="dib">
  301. <span class="icon iconfont iconshangpin"></span>
  302. <div class="name">
  303. 商品
  304. </div>
  305. <div class="code-name">.iconshangpin
  306. </div>
  307. </li>
  308. <li class="dib">
  309. <span class="icon iconfont iconcaigou"></span>
  310. <div class="name">
  311. 采购
  312. </div>
  313. <div class="code-name">.iconcaigou
  314. </div>
  315. </li>
  316. <li class="dib">
  317. <span class="icon iconfont icondizhi"></span>
  318. <div class="name">
  319. 地址
  320. </div>
  321. <div class="code-name">.icondizhi
  322. </div>
  323. </li>
  324. <li class="dib">
  325. <span class="icon iconfont iconzhaodaimai"></span>
  326. <div class="name">
  327. 找代卖
  328. </div>
  329. <div class="code-name">.iconzhaodaimai
  330. </div>
  331. </li>
  332. <li class="dib">
  333. <span class="icon iconfont iconGroup2"></span>
  334. <div class="name">
  335. Group 2
  336. </div>
  337. <div class="code-name">.iconGroup2
  338. </div>
  339. </li>
  340. <li class="dib">
  341. <span class="icon iconfont iconfabu1"></span>
  342. <div class="name">
  343. 发布1
  344. </div>
  345. <div class="code-name">.iconfabu1
  346. </div>
  347. </li>
  348. <li class="dib">
  349. <span class="icon iconfont iconhome"></span>
  350. <div class="name">
  351. home
  352. </div>
  353. <div class="code-name">.iconhome
  354. </div>
  355. </li>
  356. <li class="dib">
  357. <span class="icon iconfont iconwode1"></span>
  358. <div class="name">
  359. 我的1
  360. </div>
  361. <div class="code-name">.iconwode1
  362. </div>
  363. </li>
  364. <li class="dib">
  365. <span class="icon iconfont iconwode2"></span>
  366. <div class="name">
  367. 我的2
  368. </div>
  369. <div class="code-name">.iconwode2
  370. </div>
  371. </li>
  372. <li class="dib">
  373. <span class="icon iconfont iconfabu2"></span>
  374. <div class="name">
  375. 发布2
  376. </div>
  377. <div class="code-name">.iconfabu2
  378. </div>
  379. </li>
  380. <li class="dib">
  381. <span class="icon iconfont iconhome2"></span>
  382. <div class="name">
  383. home2
  384. </div>
  385. <div class="code-name">.iconhome2
  386. </div>
  387. </li>
  388. </ul>
  389. <div class="article markdown">
  390. <h2 id="font-class-">font-class 引用</h2>
  391. <hr>
  392. <p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p>
  393. <p>与 Unicode 使用方式相比,具有如下特点:</p>
  394. <ul>
  395. <li>兼容性良好,支持 IE8+,及所有现代浏览器。</li>
  396. <li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li>
  397. <li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li>
  398. <li>不过因为本质上还是使用的字体,所以多色图标还是不支持的。</li>
  399. </ul>
  400. <p>使用步骤如下:</p>
  401. <h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
  402. <pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt;
  403. </code></pre>
  404. <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
  405. <pre><code class="language-html">&lt;span class="iconfont iconxxx"&gt;&lt;/span&gt;
  406. </code></pre>
  407. <blockquote>
  408. <p>"
  409. iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
  410. </blockquote>
  411. </div>
  412. </div>
  413. <div class="content symbol">
  414. <ul class="icon_lists dib-box">
  415. <li class="dib">
  416. <svg class="icon svg-icon" aria-hidden="true">
  417. <use xlink:href="#iconhoutui"></use>
  418. </svg>
  419. <div class="name">后退</div>
  420. <div class="code-name">#iconhoutui</div>
  421. </li>
  422. <li class="dib">
  423. <svg class="icon svg-icon" aria-hidden="true">
  424. <use xlink:href="#iconjia"></use>
  425. </svg>
  426. <div class="name">加</div>
  427. <div class="code-name">#iconjia</div>
  428. </li>
  429. <li class="dib">
  430. <svg class="icon svg-icon" aria-hidden="true">
  431. <use xlink:href="#iconjian"></use>
  432. </svg>
  433. <div class="name">减</div>
  434. <div class="code-name">#iconjian</div>
  435. </li>
  436. <li class="dib">
  437. <svg class="icon svg-icon" aria-hidden="true">
  438. <use xlink:href="#icondizhi1"></use>
  439. </svg>
  440. <div class="name">地质</div>
  441. <div class="code-name">#icondizhi1</div>
  442. </li>
  443. <li class="dib">
  444. <svg class="icon svg-icon" aria-hidden="true">
  445. <use xlink:href="#iconfengyunbang"></use>
  446. </svg>
  447. <div class="name">风云榜</div>
  448. <div class="code-name">#iconfengyunbang</div>
  449. </li>
  450. <li class="dib">
  451. <svg class="icon svg-icon" aria-hidden="true">
  452. <use xlink:href="#icongengduo"></use>
  453. </svg>
  454. <div class="name">更多</div>
  455. <div class="code-name">#icongengduo</div>
  456. </li>
  457. <li class="dib">
  458. <svg class="icon svg-icon" aria-hidden="true">
  459. <use xlink:href="#iconbao3"></use>
  460. </svg>
  461. <div class="name">保(3)</div>
  462. <div class="code-name">#iconbao3</div>
  463. </li>
  464. <li class="dib">
  465. <svg class="icon svg-icon" aria-hidden="true">
  466. <use xlink:href="#iconwodetuandui"></use>
  467. </svg>
  468. <div class="name">企业认证</div>
  469. <div class="code-name">#iconwodetuandui</div>
  470. </li>
  471. <li class="dib">
  472. <svg class="icon svg-icon" aria-hidden="true">
  473. <use xlink:href="#iconjiahao"></use>
  474. </svg>
  475. <div class="name">加号</div>
  476. <div class="code-name">#iconjiahao</div>
  477. </li>
  478. <li class="dib">
  479. <svg class="icon svg-icon" aria-hidden="true">
  480. <use xlink:href="#iconwodedingdan"></use>
  481. </svg>
  482. <div class="name">我的订单</div>
  483. <div class="code-name">#iconwodedingdan</div>
  484. </li>
  485. <li class="dib">
  486. <svg class="icon svg-icon" aria-hidden="true">
  487. <use xlink:href="#iconGroup"></use>
  488. </svg>
  489. <div class="name">Group</div>
  490. <div class="code-name">#iconGroup</div>
  491. </li>
  492. <li class="dib">
  493. <svg class="icon svg-icon" aria-hidden="true">
  494. <use xlink:href="#iconbangzhu"></use>
  495. </svg>
  496. <div class="name">帮助</div>
  497. <div class="code-name">#iconbangzhu</div>
  498. </li>
  499. <li class="dib">
  500. <svg class="icon svg-icon" aria-hidden="true">
  501. <use xlink:href="#icondianhua"></use>
  502. </svg>
  503. <div class="name">电话</div>
  504. <div class="code-name">#icondianhua</div>
  505. </li>
  506. <li class="dib">
  507. <svg class="icon svg-icon" aria-hidden="true">
  508. <use xlink:href="#iconshangpin"></use>
  509. </svg>
  510. <div class="name">商品</div>
  511. <div class="code-name">#iconshangpin</div>
  512. </li>
  513. <li class="dib">
  514. <svg class="icon svg-icon" aria-hidden="true">
  515. <use xlink:href="#iconcaigou"></use>
  516. </svg>
  517. <div class="name">采购</div>
  518. <div class="code-name">#iconcaigou</div>
  519. </li>
  520. <li class="dib">
  521. <svg class="icon svg-icon" aria-hidden="true">
  522. <use xlink:href="#icondizhi"></use>
  523. </svg>
  524. <div class="name">地址</div>
  525. <div class="code-name">#icondizhi</div>
  526. </li>
  527. <li class="dib">
  528. <svg class="icon svg-icon" aria-hidden="true">
  529. <use xlink:href="#iconzhaodaimai"></use>
  530. </svg>
  531. <div class="name">找代卖</div>
  532. <div class="code-name">#iconzhaodaimai</div>
  533. </li>
  534. <li class="dib">
  535. <svg class="icon svg-icon" aria-hidden="true">
  536. <use xlink:href="#iconGroup2"></use>
  537. </svg>
  538. <div class="name">Group 2</div>
  539. <div class="code-name">#iconGroup2</div>
  540. </li>
  541. <li class="dib">
  542. <svg class="icon svg-icon" aria-hidden="true">
  543. <use xlink:href="#iconfabu1"></use>
  544. </svg>
  545. <div class="name">发布1</div>
  546. <div class="code-name">#iconfabu1</div>
  547. </li>
  548. <li class="dib">
  549. <svg class="icon svg-icon" aria-hidden="true">
  550. <use xlink:href="#iconhome"></use>
  551. </svg>
  552. <div class="name">home</div>
  553. <div class="code-name">#iconhome</div>
  554. </li>
  555. <li class="dib">
  556. <svg class="icon svg-icon" aria-hidden="true">
  557. <use xlink:href="#iconwode1"></use>
  558. </svg>
  559. <div class="name">我的1</div>
  560. <div class="code-name">#iconwode1</div>
  561. </li>
  562. <li class="dib">
  563. <svg class="icon svg-icon" aria-hidden="true">
  564. <use xlink:href="#iconwode2"></use>
  565. </svg>
  566. <div class="name">我的2</div>
  567. <div class="code-name">#iconwode2</div>
  568. </li>
  569. <li class="dib">
  570. <svg class="icon svg-icon" aria-hidden="true">
  571. <use xlink:href="#iconfabu2"></use>
  572. </svg>
  573. <div class="name">发布2</div>
  574. <div class="code-name">#iconfabu2</div>
  575. </li>
  576. <li class="dib">
  577. <svg class="icon svg-icon" aria-hidden="true">
  578. <use xlink:href="#iconhome2"></use>
  579. </svg>
  580. <div class="name">home2</div>
  581. <div class="code-name">#iconhome2</div>
  582. </li>
  583. </ul>
  584. <div class="article markdown">
  585. <h2 id="symbol-">Symbol 引用</h2>
  586. <hr>
  587. <p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
  588. 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p>
  589. <ul>
  590. <li>支持多色图标了,不再受单色限制。</li>
  591. <li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li>
  592. <li>兼容性较差,支持 IE9+,及现代浏览器。</li>
  593. <li>浏览器渲染 SVG 的性能一般,还不如 png。</li>
  594. </ul>
  595. <p>使用步骤如下:</p>
  596. <h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
  597. <pre><code class="language-html">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;
  598. </code></pre>
  599. <h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
  600. <pre><code class="language-html">&lt;style&gt;
  601. .icon {
  602. width: 1em;
  603. height: 1em;
  604. vertical-align: -0.15em;
  605. fill: currentColor;
  606. overflow: hidden;
  607. }
  608. &lt;/style&gt;
  609. </code></pre>
  610. <h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
  611. <pre><code class="language-html">&lt;svg class="icon" aria-hidden="true"&gt;
  612. &lt;use xlink:href="#icon-xxx"&gt;&lt;/use&gt;
  613. &lt;/svg&gt;
  614. </code></pre>
  615. </div>
  616. </div>
  617. </div>
  618. </div>
  619. <script>
  620. $(document).ready(function () {
  621. $('.tab-container .content:first').show()
  622. $('#tabs li').click(function (e) {
  623. var tabContent = $('.tab-container .content')
  624. var index = $(this).index()
  625. if ($(this).hasClass('active')) {
  626. return
  627. } else {
  628. $('#tabs li').removeClass('active')
  629. $(this).addClass('active')
  630. tabContent.hide().eq(index).fadeIn()
  631. }
  632. })
  633. })
  634. </script>
  635. </body>
  636. </html>