demo_unicode.html 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <title>IconFont</title>
  6. <link rel="stylesheet" href="demo.css">
  7. <style type="text/css">
  8. @font-face {font-family: "iconfont";
  9. src: url('iconfont.eot'); /* IE9*/
  10. src: url('iconfont.eot#iefix') format('embedded-opentype'), /* IE6-IE8 */
  11. url('iconfont.woff') format('woff'), /* chrome, firefox */
  12. url('iconfont.ttf') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
  13. url('iconfont.svg#iconfont') format('svg'); /* iOS 4.1- */
  14. }
  15. .iconfont {
  16. font-family:"iconfont" !important;
  17. font-size:16px;
  18. font-style:normal;
  19. -webkit-font-smoothing: antialiased;
  20. -webkit-text-stroke-width: 0.2px;
  21. -moz-osx-font-smoothing: grayscale;
  22. }
  23. </style>
  24. </head>
  25. <body>
  26. <div class="main markdown">
  27. <h1>IconFont 图标</h1>
  28. <ul class="icon_lists clear">
  29. <li>
  30. <i class="icon iconfont">&#xe63d;</i>
  31. <div class="name">关机</div>
  32. <div class="code">&amp;#xe63d;</div>
  33. </li>
  34. <li>
  35. <i class="icon iconfont">&#xe69a;</i>
  36. <div class="name">close</div>
  37. <div class="code">&amp;#xe69a;</div>
  38. </li>
  39. <li>
  40. <i class="icon iconfont">&#xe613;</i>
  41. <div class="name">删除</div>
  42. <div class="code">&amp;#xe613;</div>
  43. </li>
  44. <li>
  45. <i class="icon iconfont">&#xe61f;</i>
  46. <div class="name">全屏</div>
  47. <div class="code">&amp;#xe61f;</div>
  48. </li>
  49. <li>
  50. <i class="icon iconfont">&#xe602;</i>
  51. <div class="name">删除</div>
  52. <div class="code">&amp;#xe602;</div>
  53. </li>
  54. <li>
  55. <i class="icon iconfont">&#xe606;</i>
  56. <div class="name">未标题-1_画板 1 副本 6</div>
  57. <div class="code">&amp;#xe606;</div>
  58. </li>
  59. <li>
  60. <i class="icon iconfont">&#xe607;</i>
  61. <div class="name">未标题-1_画板 1 副本 7</div>
  62. <div class="code">&amp;#xe607;</div>
  63. </li>
  64. <li>
  65. <i class="icon iconfont">&#xe608;</i>
  66. <div class="name">未标题-1_画板 1 副本 11</div>
  67. <div class="code">&amp;#xe608;</div>
  68. </li>
  69. <li>
  70. <i class="icon iconfont">&#xe609;</i>
  71. <div class="name">未标题-1_画板 1 副本 10</div>
  72. <div class="code">&amp;#xe609;</div>
  73. </li>
  74. <li>
  75. <i class="icon iconfont">&#xe60a;</i>
  76. <div class="name">未标题-1_画板 1 副本 9</div>
  77. <div class="code">&amp;#xe60a;</div>
  78. </li>
  79. <li>
  80. <i class="icon iconfont">&#xe60b;</i>
  81. <div class="name">未标题-1_画板 1 副本 8</div>
  82. <div class="code">&amp;#xe60b;</div>
  83. </li>
  84. <li>
  85. <i class="icon iconfont">&#xe612;</i>
  86. <div class="name">未标题-1_Time-active</div>
  87. <div class="code">&amp;#xe612;</div>
  88. </li>
  89. <li>
  90. <i class="icon iconfont">&#xe614;</i>
  91. <div class="name">未标题-1_b-active</div>
  92. <div class="code">&amp;#xe614;</div>
  93. </li>
  94. <li>
  95. <i class="icon iconfont">&#xe615;</i>
  96. <div class="name">未标题-1_A-active</div>
  97. <div class="code">&amp;#xe615;</div>
  98. </li>
  99. <li>
  100. <i class="icon iconfont">&#xe616;</i>
  101. <div class="name">未标题-1_Add-active</div>
  102. <div class="code">&amp;#xe616;</div>
  103. </li>
  104. <li>
  105. <i class="icon iconfont">&#xe617;</i>
  106. <div class="name">未标题-1_center-active</div>
  107. <div class="code">&amp;#xe617;</div>
  108. </li>
  109. <li>
  110. <i class="icon iconfont">&#xe618;</i>
  111. <div class="name">未标题-1_life-active</div>
  112. <div class="code">&amp;#xe618;</div>
  113. </li>
  114. <li>
  115. <i class="icon iconfont">&#xe619;</i>
  116. <div class="name">未标题-1_youxu-active</div>
  117. <div class="code">&amp;#xe619;</div>
  118. </li>
  119. <li>
  120. <i class="icon iconfont">&#xe61a;</i>
  121. <div class="name">未标题-1_right-active</div>
  122. <div class="code">&amp;#xe61a;</div>
  123. </li>
  124. <li>
  125. <i class="icon iconfont">&#xe61b;</i>
  126. <div class="name">未标题-1_U-active</div>
  127. <div class="code">&amp;#xe61b;</div>
  128. </li>
  129. <li>
  130. <i class="icon iconfont">&#xe61c;</i>
  131. <div class="name">未标题-1_wuxu-active</div>
  132. <div class="code">&amp;#xe61c;</div>
  133. </li>
  134. <li>
  135. <i class="icon iconfont">&#xe61d;</i>
  136. <div class="name">未标题-1_Pic-active</div>
  137. <div class="code">&amp;#xe61d;</div>
  138. </li>
  139. <li>
  140. <i class="icon iconfont">&#xe61e;</i>
  141. <div class="name">未标题-1_I-active</div>
  142. <div class="code">&amp;#xe61e;</div>
  143. </li>
  144. <li>
  145. <i class="icon iconfont">&#xe620;</i>
  146. <div class="name">合并 (1)</div>
  147. <div class="code">&amp;#xe620;</div>
  148. </li>
  149. <li>
  150. <i class="icon iconfont">&#xe621;</i>
  151. <div class="name">裁剪</div>
  152. <div class="code">&amp;#xe621;</div>
  153. </li>
  154. <li>
  155. <i class="icon iconfont">&#xe622;</i>
  156. <div class="name">剪切</div>
  157. <div class="code">&amp;#xe622;</div>
  158. </li>
  159. <li>
  160. <i class="icon iconfont">&#xe623;</i>
  161. <div class="name">循环2</div>
  162. <div class="code">&amp;#xe623;</div>
  163. </li>
  164. </ul>
  165. <h2 id="unicode-">unicode引用</h2>
  166. <hr>
  167. <p>unicode是字体在网页端最原始的应用方式,特点是:</p>
  168. <ul>
  169. <li>兼容性最好,支持ie6+,及所有现代浏览器。</li>
  170. <li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
  171. <li>但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。</li>
  172. </ul>
  173. <blockquote>
  174. <p>注意:新版iconfont支持多色图标,这些多色图标在unicode模式下将不能使用,如果有需求建议使用symbol的引用方式</p>
  175. </blockquote>
  176. <p>unicode使用步骤如下:</p>
  177. <h3 id="-font-face">第一步:拷贝项目下面生成的font-face</h3>
  178. <pre><code class="lang-js hljs javascript">@font-face {
  179. font-family: <span class="hljs-string">'iconfont'</span>;
  180. src: url(<span class="hljs-string">'iconfont.eot'</span>);
  181. src: url(<span class="hljs-string">'iconfont.eot?#iefix'</span>) format(<span class="hljs-string">'embedded-opentype'</span>),
  182. url(<span class="hljs-string">'iconfont.woff'</span>) format(<span class="hljs-string">'woff'</span>),
  183. url(<span class="hljs-string">'iconfont.ttf'</span>) format(<span class="hljs-string">'truetype'</span>),
  184. url(<span class="hljs-string">'iconfont.svg#iconfont'</span>) format(<span class="hljs-string">'svg'</span>);
  185. }
  186. </code></pre>
  187. <h3 id="-iconfont-">第二步:定义使用iconfont的样式</h3>
  188. <pre><code class="lang-js hljs javascript">.iconfont{
  189. font-family:<span class="hljs-string">"iconfont"</span> !important;
  190. font-size:<span class="hljs-number">16</span>px;font-style:normal;
  191. -webkit-font-smoothing: antialiased;
  192. -webkit-text-stroke-width: <span class="hljs-number">0.2</span>px;
  193. -moz-osx-font-smoothing: grayscale;
  194. }
  195. </code></pre>
  196. <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
  197. <pre><code class="lang-js hljs javascript">&lt;i <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"iconfont"</span>&gt;&amp;#x33;<span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span></span></code></pre>
  198. <blockquote>
  199. <p>"iconfont"是你项目下的font-family。可以通过编辑项目查看,默认是"iconfont"。</p>
  200. </blockquote>
  201. </div>
  202. </body>
  203. </html>