星火管控前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

demo_index.html 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  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/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" type="image/x-icon"/>
  7. <link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.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. <a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=4468064" target="_blank" class="nav-more">查看项目</a>
  47. </div>
  48. <div class="tab-container">
  49. <div class="content unicode" style="display: block;">
  50. <ul class="icon_lists dib-box">
  51. <li class="dib">
  52. <span class="icon iconfont">&#xe703;</span>
  53. <div class="name">关注-已关注</div>
  54. <div class="code-name">&amp;#xe703;</div>
  55. </li>
  56. <li class="dib">
  57. <span class="icon iconfont">&#xe6a2;</span>
  58. <div class="name">钉-面型</div>
  59. <div class="code-name">&amp;#xe6a2;</div>
  60. </li>
  61. <li class="dib">
  62. <span class="icon iconfont">&#xe60a;</span>
  63. <div class="name">验证码</div>
  64. <div class="code-name">&amp;#xe60a;</div>
  65. </li>
  66. <li class="dib">
  67. <span class="icon iconfont">&#xe62f;</span>
  68. <div class="name">默认头像</div>
  69. <div class="code-name">&amp;#xe62f;</div>
  70. </li>
  71. <li class="dib">
  72. <span class="icon iconfont">&#xe605;</span>
  73. <div class="name">箭头</div>
  74. <div class="code-name">&amp;#xe605;</div>
  75. </li>
  76. <li class="dib">
  77. <span class="icon iconfont">&#xe600;</span>
  78. <div class="name">电量</div>
  79. <div class="code-name">&amp;#xe600;</div>
  80. </li>
  81. <li class="dib">
  82. <span class="icon iconfont">&#xe627;</span>
  83. <div class="name">gengxin</div>
  84. <div class="code-name">&amp;#xe627;</div>
  85. </li>
  86. <li class="dib">
  87. <span class="icon iconfont">&#xf06a;</span>
  88. <div class="name">手机</div>
  89. <div class="code-name">&amp;#xf06a;</div>
  90. </li>
  91. <li class="dib">
  92. <span class="icon iconfont">&#xe7ba;</span>
  93. <div class="name">安卓android</div>
  94. <div class="code-name">&amp;#xe7ba;</div>
  95. </li>
  96. <li class="dib">
  97. <span class="icon iconfont">&#xe61b;</span>
  98. <div class="name">数量流量</div>
  99. <div class="code-name">&amp;#xe61b;</div>
  100. </li>
  101. <li class="dib">
  102. <span class="icon iconfont">&#xe7c5;</span>
  103. <div class="name">USB</div>
  104. <div class="code-name">&amp;#xe7c5;</div>
  105. </li>
  106. <li class="dib">
  107. <span class="icon iconfont">&#xe606;</span>
  108. <div class="name">wifi关闭</div>
  109. <div class="code-name">&amp;#xe606;</div>
  110. </li>
  111. <li class="dib">
  112. <span class="icon iconfont">&#xe643;</span>
  113. <div class="name">复制</div>
  114. <div class="code-name">&amp;#xe643;</div>
  115. </li>
  116. <li class="dib">
  117. <span class="icon iconfont">&#xe657;</span>
  118. <div class="name">icon-OTG</div>
  119. <div class="code-name">&amp;#xe657;</div>
  120. </li>
  121. <li class="dib">
  122. <span class="icon iconfont">&#xe610;</span>
  123. <div class="name">录音</div>
  124. <div class="code-name">&amp;#xe610;</div>
  125. </li>
  126. <li class="dib">
  127. <span class="icon iconfont">&#xe6b2;</span>
  128. <div class="name">蓝牙</div>
  129. <div class="code-name">&amp;#xe6b2;</div>
  130. </li>
  131. <li class="dib">
  132. <span class="icon iconfont">&#xe680;</span>
  133. <div class="name">sd卡</div>
  134. <div class="code-name">&amp;#xe680;</div>
  135. </li>
  136. <li class="dib">
  137. <span class="icon iconfont">&#xe965;</span>
  138. <div class="name">摄像头</div>
  139. <div class="code-name">&amp;#xe965;</div>
  140. </li>
  141. <li class="dib">
  142. <span class="icon iconfont">&#xe6fc;</span>
  143. <div class="name">电话短信_line</div>
  144. <div class="code-name">&amp;#xe6fc;</div>
  145. </li>
  146. <li class="dib">
  147. <span class="icon iconfont">&#xe68b;</span>
  148. <div class="name">bx-wifi-2</div>
  149. <div class="code-name">&amp;#xe68b;</div>
  150. </li>
  151. <li class="dib">
  152. <span class="icon iconfont">&#xe67c;</span>
  153. <div class="name">GPS信息</div>
  154. <div class="code-name">&amp;#xe67c;</div>
  155. </li>
  156. <li class="dib">
  157. <span class="icon iconfont">&#xe616;</span>
  158. <div class="name">wifi_fiber</div>
  159. <div class="code-name">&amp;#xe616;</div>
  160. </li>
  161. </ul>
  162. <div class="article markdown">
  163. <h2 id="unicode-">Unicode 引用</h2>
  164. <hr>
  165. <p>Unicode 是字体在网页端最原始的应用方式,特点是:</p>
  166. <ul>
  167. <li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
  168. <li>默认情况下不支持多色,直接添加多色图标会自动去色。</li>
  169. </ul>
  170. <blockquote>
  171. <p>注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)</p>
  172. </blockquote>
  173. <p>Unicode 使用步骤如下:</p>
  174. <h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
  175. <pre><code class="language-css"
  176. >@font-face {
  177. font-family: 'iconfont';
  178. src: url('iconfont.woff2?t=1712026774551') format('woff2'),
  179. url('iconfont.woff?t=1712026774551') format('woff'),
  180. url('iconfont.ttf?t=1712026774551') format('truetype');
  181. }
  182. </code></pre>
  183. <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
  184. <pre><code class="language-css"
  185. >.iconfont {
  186. font-family: "iconfont" !important;
  187. font-size: 16px;
  188. font-style: normal;
  189. -webkit-font-smoothing: antialiased;
  190. -moz-osx-font-smoothing: grayscale;
  191. }
  192. </code></pre>
  193. <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
  194. <pre>
  195. <code class="language-html"
  196. >&lt;span class="iconfont"&gt;&amp;#x33;&lt;/span&gt;
  197. </code></pre>
  198. <blockquote>
  199. <p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
  200. </blockquote>
  201. </div>
  202. </div>
  203. <div class="content font-class">
  204. <ul class="icon_lists dib-box">
  205. <li class="dib">
  206. <span class="icon iconfont icon-guanzhu-yiguanzhu"></span>
  207. <div class="name">
  208. 关注-已关注
  209. </div>
  210. <div class="code-name">.icon-guanzhu-yiguanzhu
  211. </div>
  212. </li>
  213. <li class="dib">
  214. <span class="icon iconfont icon-ding-mianxing"></span>
  215. <div class="name">
  216. 钉-面型
  217. </div>
  218. <div class="code-name">.icon-ding-mianxing
  219. </div>
  220. </li>
  221. <li class="dib">
  222. <span class="icon iconfont icon-yanzhengma"></span>
  223. <div class="name">
  224. 验证码
  225. </div>
  226. <div class="code-name">.icon-yanzhengma
  227. </div>
  228. </li>
  229. <li class="dib">
  230. <span class="icon iconfont icon-morentouxiang"></span>
  231. <div class="name">
  232. 默认头像
  233. </div>
  234. <div class="code-name">.icon-morentouxiang
  235. </div>
  236. </li>
  237. <li class="dib">
  238. <span class="icon iconfont icon-jiantou"></span>
  239. <div class="name">
  240. 箭头
  241. </div>
  242. <div class="code-name">.icon-jiantou
  243. </div>
  244. </li>
  245. <li class="dib">
  246. <span class="icon iconfont icon-shixin-dianliang-dianliang10"></span>
  247. <div class="name">
  248. 电量
  249. </div>
  250. <div class="code-name">.icon-shixin-dianliang-dianliang10
  251. </div>
  252. </li>
  253. <li class="dib">
  254. <span class="icon iconfont icon-weibiaoti--"></span>
  255. <div class="name">
  256. gengxin
  257. </div>
  258. <div class="code-name">.icon-weibiaoti--
  259. </div>
  260. </li>
  261. <li class="dib">
  262. <span class="icon iconfont icon-shouji"></span>
  263. <div class="name">
  264. 手机
  265. </div>
  266. <div class="code-name">.icon-shouji
  267. </div>
  268. </li>
  269. <li class="dib">
  270. <span class="icon iconfont icon-anzhuoandroid"></span>
  271. <div class="name">
  272. 安卓android
  273. </div>
  274. <div class="code-name">.icon-anzhuoandroid
  275. </div>
  276. </li>
  277. <li class="dib">
  278. <span class="icon iconfont icon-liuliang"></span>
  279. <div class="name">
  280. 数量流量
  281. </div>
  282. <div class="code-name">.icon-liuliang
  283. </div>
  284. </li>
  285. <li class="dib">
  286. <span class="icon iconfont icon-USB"></span>
  287. <div class="name">
  288. USB
  289. </div>
  290. <div class="code-name">.icon-USB
  291. </div>
  292. </li>
  293. <li class="dib">
  294. <span class="icon iconfont icon-wifiguanbi"></span>
  295. <div class="name">
  296. wifi关闭
  297. </div>
  298. <div class="code-name">.icon-wifiguanbi
  299. </div>
  300. </li>
  301. <li class="dib">
  302. <span class="icon iconfont icon-fuzhi"></span>
  303. <div class="name">
  304. 复制
  305. </div>
  306. <div class="code-name">.icon-fuzhi
  307. </div>
  308. </li>
  309. <li class="dib">
  310. <span class="icon iconfont icon-icon-OTG"></span>
  311. <div class="name">
  312. icon-OTG
  313. </div>
  314. <div class="code-name">.icon-icon-OTG
  315. </div>
  316. </li>
  317. <li class="dib">
  318. <span class="icon iconfont icon-luyin"></span>
  319. <div class="name">
  320. 录音
  321. </div>
  322. <div class="code-name">.icon-luyin
  323. </div>
  324. </li>
  325. <li class="dib">
  326. <span class="icon iconfont icon-lanya"></span>
  327. <div class="name">
  328. 蓝牙
  329. </div>
  330. <div class="code-name">.icon-lanya
  331. </div>
  332. </li>
  333. <li class="dib">
  334. <span class="icon iconfont icon-sdka-09"></span>
  335. <div class="name">
  336. sd卡
  337. </div>
  338. <div class="code-name">.icon-sdka-09
  339. </div>
  340. </li>
  341. <li class="dib">
  342. <span class="icon iconfont icon-ball-camera"></span>
  343. <div class="name">
  344. 摄像头
  345. </div>
  346. <div class="code-name">.icon-ball-camera
  347. </div>
  348. </li>
  349. <li class="dib">
  350. <span class="icon iconfont icon-dianhuaduanxin_line"></span>
  351. <div class="name">
  352. 电话短信_line
  353. </div>
  354. <div class="code-name">.icon-dianhuaduanxin_line
  355. </div>
  356. </li>
  357. <li class="dib">
  358. <span class="icon iconfont icon-bx-wifi-2"></span>
  359. <div class="name">
  360. bx-wifi-2
  361. </div>
  362. <div class="code-name">.icon-bx-wifi-2
  363. </div>
  364. </li>
  365. <li class="dib">
  366. <span class="icon iconfont icon-GPSxinxi"></span>
  367. <div class="name">
  368. GPS信息
  369. </div>
  370. <div class="code-name">.icon-GPSxinxi
  371. </div>
  372. </li>
  373. <li class="dib">
  374. <span class="icon iconfont icon-wifi_fiber"></span>
  375. <div class="name">
  376. wifi_fiber
  377. </div>
  378. <div class="code-name">.icon-wifi_fiber
  379. </div>
  380. </li>
  381. </ul>
  382. <div class="article markdown">
  383. <h2 id="font-class-">font-class 引用</h2>
  384. <hr>
  385. <p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p>
  386. <p>与 Unicode 使用方式相比,具有如下特点:</p>
  387. <ul>
  388. <li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li>
  389. <li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li>
  390. </ul>
  391. <p>使用步骤如下:</p>
  392. <h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
  393. <pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt;
  394. </code></pre>
  395. <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
  396. <pre><code class="language-html">&lt;span class="iconfont icon-xxx"&gt;&lt;/span&gt;
  397. </code></pre>
  398. <blockquote>
  399. <p>"
  400. iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
  401. </blockquote>
  402. </div>
  403. </div>
  404. <div class="content symbol">
  405. <ul class="icon_lists dib-box">
  406. <li class="dib">
  407. <svg class="icon svg-icon" aria-hidden="true">
  408. <use xlink:href="#icon-guanzhu-yiguanzhu"></use>
  409. </svg>
  410. <div class="name">关注-已关注</div>
  411. <div class="code-name">#icon-guanzhu-yiguanzhu</div>
  412. </li>
  413. <li class="dib">
  414. <svg class="icon svg-icon" aria-hidden="true">
  415. <use xlink:href="#icon-ding-mianxing"></use>
  416. </svg>
  417. <div class="name">钉-面型</div>
  418. <div class="code-name">#icon-ding-mianxing</div>
  419. </li>
  420. <li class="dib">
  421. <svg class="icon svg-icon" aria-hidden="true">
  422. <use xlink:href="#icon-yanzhengma"></use>
  423. </svg>
  424. <div class="name">验证码</div>
  425. <div class="code-name">#icon-yanzhengma</div>
  426. </li>
  427. <li class="dib">
  428. <svg class="icon svg-icon" aria-hidden="true">
  429. <use xlink:href="#icon-morentouxiang"></use>
  430. </svg>
  431. <div class="name">默认头像</div>
  432. <div class="code-name">#icon-morentouxiang</div>
  433. </li>
  434. <li class="dib">
  435. <svg class="icon svg-icon" aria-hidden="true">
  436. <use xlink:href="#icon-jiantou"></use>
  437. </svg>
  438. <div class="name">箭头</div>
  439. <div class="code-name">#icon-jiantou</div>
  440. </li>
  441. <li class="dib">
  442. <svg class="icon svg-icon" aria-hidden="true">
  443. <use xlink:href="#icon-shixin-dianliang-dianliang10"></use>
  444. </svg>
  445. <div class="name">电量</div>
  446. <div class="code-name">#icon-shixin-dianliang-dianliang10</div>
  447. </li>
  448. <li class="dib">
  449. <svg class="icon svg-icon" aria-hidden="true">
  450. <use xlink:href="#icon-weibiaoti--"></use>
  451. </svg>
  452. <div class="name">gengxin</div>
  453. <div class="code-name">#icon-weibiaoti--</div>
  454. </li>
  455. <li class="dib">
  456. <svg class="icon svg-icon" aria-hidden="true">
  457. <use xlink:href="#icon-shouji"></use>
  458. </svg>
  459. <div class="name">手机</div>
  460. <div class="code-name">#icon-shouji</div>
  461. </li>
  462. <li class="dib">
  463. <svg class="icon svg-icon" aria-hidden="true">
  464. <use xlink:href="#icon-anzhuoandroid"></use>
  465. </svg>
  466. <div class="name">安卓android</div>
  467. <div class="code-name">#icon-anzhuoandroid</div>
  468. </li>
  469. <li class="dib">
  470. <svg class="icon svg-icon" aria-hidden="true">
  471. <use xlink:href="#icon-liuliang"></use>
  472. </svg>
  473. <div class="name">数量流量</div>
  474. <div class="code-name">#icon-liuliang</div>
  475. </li>
  476. <li class="dib">
  477. <svg class="icon svg-icon" aria-hidden="true">
  478. <use xlink:href="#icon-USB"></use>
  479. </svg>
  480. <div class="name">USB</div>
  481. <div class="code-name">#icon-USB</div>
  482. </li>
  483. <li class="dib">
  484. <svg class="icon svg-icon" aria-hidden="true">
  485. <use xlink:href="#icon-wifiguanbi"></use>
  486. </svg>
  487. <div class="name">wifi关闭</div>
  488. <div class="code-name">#icon-wifiguanbi</div>
  489. </li>
  490. <li class="dib">
  491. <svg class="icon svg-icon" aria-hidden="true">
  492. <use xlink:href="#icon-fuzhi"></use>
  493. </svg>
  494. <div class="name">复制</div>
  495. <div class="code-name">#icon-fuzhi</div>
  496. </li>
  497. <li class="dib">
  498. <svg class="icon svg-icon" aria-hidden="true">
  499. <use xlink:href="#icon-icon-OTG"></use>
  500. </svg>
  501. <div class="name">icon-OTG</div>
  502. <div class="code-name">#icon-icon-OTG</div>
  503. </li>
  504. <li class="dib">
  505. <svg class="icon svg-icon" aria-hidden="true">
  506. <use xlink:href="#icon-luyin"></use>
  507. </svg>
  508. <div class="name">录音</div>
  509. <div class="code-name">#icon-luyin</div>
  510. </li>
  511. <li class="dib">
  512. <svg class="icon svg-icon" aria-hidden="true">
  513. <use xlink:href="#icon-lanya"></use>
  514. </svg>
  515. <div class="name">蓝牙</div>
  516. <div class="code-name">#icon-lanya</div>
  517. </li>
  518. <li class="dib">
  519. <svg class="icon svg-icon" aria-hidden="true">
  520. <use xlink:href="#icon-sdka-09"></use>
  521. </svg>
  522. <div class="name">sd卡</div>
  523. <div class="code-name">#icon-sdka-09</div>
  524. </li>
  525. <li class="dib">
  526. <svg class="icon svg-icon" aria-hidden="true">
  527. <use xlink:href="#icon-ball-camera"></use>
  528. </svg>
  529. <div class="name">摄像头</div>
  530. <div class="code-name">#icon-ball-camera</div>
  531. </li>
  532. <li class="dib">
  533. <svg class="icon svg-icon" aria-hidden="true">
  534. <use xlink:href="#icon-dianhuaduanxin_line"></use>
  535. </svg>
  536. <div class="name">电话短信_line</div>
  537. <div class="code-name">#icon-dianhuaduanxin_line</div>
  538. </li>
  539. <li class="dib">
  540. <svg class="icon svg-icon" aria-hidden="true">
  541. <use xlink:href="#icon-bx-wifi-2"></use>
  542. </svg>
  543. <div class="name">bx-wifi-2</div>
  544. <div class="code-name">#icon-bx-wifi-2</div>
  545. </li>
  546. <li class="dib">
  547. <svg class="icon svg-icon" aria-hidden="true">
  548. <use xlink:href="#icon-GPSxinxi"></use>
  549. </svg>
  550. <div class="name">GPS信息</div>
  551. <div class="code-name">#icon-GPSxinxi</div>
  552. </li>
  553. <li class="dib">
  554. <svg class="icon svg-icon" aria-hidden="true">
  555. <use xlink:href="#icon-wifi_fiber"></use>
  556. </svg>
  557. <div class="name">wifi_fiber</div>
  558. <div class="code-name">#icon-wifi_fiber</div>
  559. </li>
  560. </ul>
  561. <div class="article markdown">
  562. <h2 id="symbol-">Symbol 引用</h2>
  563. <hr>
  564. <p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
  565. 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p>
  566. <ul>
  567. <li>支持多色图标了,不再受单色限制。</li>
  568. <li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li>
  569. <li>兼容性较差,支持 IE9+,及现代浏览器。</li>
  570. <li>浏览器渲染 SVG 的性能一般,还不如 png。</li>
  571. </ul>
  572. <p>使用步骤如下:</p>
  573. <h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
  574. <pre><code class="language-html">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;
  575. </code></pre>
  576. <h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
  577. <pre><code class="language-html">&lt;style&gt;
  578. .icon {
  579. width: 1em;
  580. height: 1em;
  581. vertical-align: -0.15em;
  582. fill: currentColor;
  583. overflow: hidden;
  584. }
  585. &lt;/style&gt;
  586. </code></pre>
  587. <h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
  588. <pre><code class="language-html">&lt;svg class="icon" aria-hidden="true"&gt;
  589. &lt;use xlink:href="#icon-xxx"&gt;&lt;/use&gt;
  590. &lt;/svg&gt;
  591. </code></pre>
  592. </div>
  593. </div>
  594. </div>
  595. </div>
  596. <script>
  597. $(document).ready(function () {
  598. $('.tab-container .content:first').show()
  599. $('#tabs li').click(function (e) {
  600. var tabContent = $('.tab-container .content')
  601. var index = $(this).index()
  602. if ($(this).hasClass('active')) {
  603. return
  604. } else {
  605. $('#tabs li').removeClass('active')
  606. $(this).addClass('active')
  607. tabContent.hide().eq(index).fadeIn()
  608. }
  609. })
  610. })
  611. </script>
  612. </body>
  613. </html>