demo_unicode.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  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: "iconflow";
  9. src: url('iconflow.eot'); /* IE9*/
  10. src: url('iconflow.eot#iefix') format('embedded-opentype'), /* IE6-IE8 */
  11. url('iconflow.woff') format('woff'), /* chrome, firefox */
  12. url('iconflow.ttf') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
  13. url('iconflow.svg#iconflow') format('svg'); /* iOS 4.1- */
  14. }
  15. .iconflow {
  16. font-family:"iconflow" !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 iconflow">&#xe602;</i>
  31. <div class="name">指针</div>
  32. <div class="code">&amp;#xe602;</div>
  33. </li>
  34. <li>
  35. <i class="icon iconflow">&#xe674;</i>
  36. <div class="name">关闭</div>
  37. <div class="code">&amp;#xe674;</div>
  38. </li>
  39. <li>
  40. <i class="icon iconflow">&#xe61a;</i>
  41. <div class="name">close</div>
  42. <div class="code">&amp;#xe61a;</div>
  43. </li>
  44. <li>
  45. <i class="icon iconflow">&#xe659;</i>
  46. <div class="name">文件添加</div>
  47. <div class="code">&amp;#xe659;</div>
  48. </li>
  49. <li>
  50. <i class="icon iconflow">&#xe6f9;</i>
  51. <div class="name">tag</div>
  52. <div class="code">&amp;#xe6f9;</div>
  53. </li>
  54. <li>
  55. <i class="icon iconflow">&#xe672;</i>
  56. <div class="name">conow-redo</div>
  57. <div class="code">&amp;#xe672;</div>
  58. </li>
  59. <li>
  60. <i class="icon iconflow">&#xe673;</i>
  61. <div class="name">conow-revoke</div>
  62. <div class="code">&amp;#xe673;</div>
  63. </li>
  64. <li>
  65. <i class="icon iconflow">&#xe63d;</i>
  66. <div class="name">保存</div>
  67. <div class="code">&amp;#xe63d;</div>
  68. </li>
  69. <li>
  70. <i class="icon iconflow">&#xe607;</i>
  71. <div class="name">Refresh</div>
  72. <div class="code">&amp;#xe607;</div>
  73. </li>
  74. <li>
  75. <i class="icon iconflow">&#xe6b7;</i>
  76. <div class="name">右下-实心</div>
  77. <div class="code">&amp;#xe6b7;</div>
  78. </li>
  79. <li>
  80. <i class="icon iconflow">&#xe6bd;</i>
  81. <div class="name">拍照按钮</div>
  82. <div class="code">&amp;#xe6bd;</div>
  83. </li>
  84. <li>
  85. <i class="icon iconflow">&#xe611;</i>
  86. <div class="name">徽章</div>
  87. <div class="code">&amp;#xe611;</div>
  88. </li>
  89. <li>
  90. <i class="icon iconflow">&#xe600;</i>
  91. <div class="name">hr工作台</div>
  92. <div class="code">&amp;#xe600;</div>
  93. </li>
  94. <li>
  95. <i class="icon iconflow">&#xe609;</i>
  96. <div class="name">停止</div>
  97. <div class="code">&amp;#xe609;</div>
  98. </li>
  99. <li>
  100. <i class="icon iconflow">&#xe7a0;</i>
  101. <div class="name">文件夹</div>
  102. <div class="code">&amp;#xe7a0;</div>
  103. </li>
  104. <li>
  105. <i class="icon iconflow">&#xe643;</i>
  106. <div class="name">声音</div>
  107. <div class="code">&amp;#xe643;</div>
  108. </li>
  109. <li>
  110. <i class="icon iconflow">&#xe742;</i>
  111. <div class="name">数据库</div>
  112. <div class="code">&amp;#xe742;</div>
  113. </li>
  114. <li>
  115. <i class="icon iconflow">&#xe66c;</i>
  116. <div class="name">插件 (1)</div>
  117. <div class="code">&amp;#xe66c;</div>
  118. </li>
  119. <li>
  120. <i class="icon iconflow">&#xe649;</i>
  121. <div class="name">菜单</div>
  122. <div class="code">&amp;#xe649;</div>
  123. </li>
  124. <li>
  125. <i class="icon iconflow">&#xe62b;</i>
  126. <div class="name">网络</div>
  127. <div class="code">&amp;#xe62b;</div>
  128. </li>
  129. <li>
  130. <i class="icon iconflow">&#xe671;</i>
  131. <div class="name">打印</div>
  132. <div class="code">&amp;#xe671;</div>
  133. </li>
  134. <li>
  135. <i class="icon iconflow">&#xe608;</i>
  136. <div class="name">线条 - 横线</div>
  137. <div class="code">&amp;#xe608;</div>
  138. </li>
  139. <li>
  140. <i class="icon iconflow">&#xe6af;</i>
  141. <div class="name">用户</div>
  142. <div class="code">&amp;#xe6af;</div>
  143. </li>
  144. <li>
  145. <i class="icon iconflow">&#xe700;</i>
  146. <div class="name">开始</div>
  147. <div class="code">&amp;#xe700;</div>
  148. </li>
  149. <li>
  150. <i class="icon iconflow">&#xe606;</i>
  151. <div class="name">合并</div>
  152. <div class="code">&amp;#xe606;</div>
  153. </li>
  154. <li>
  155. <i class="icon iconflow">&#xe61b;</i>
  156. <div class="name">聊天</div>
  157. <div class="code">&amp;#xe61b;</div>
  158. </li>
  159. <li>
  160. <i class="icon iconflow">&#xe633;</i>
  161. <div class="name">定时</div>
  162. <div class="code">&amp;#xe633;</div>
  163. </li>
  164. <li>
  165. <i class="icon iconflow">&#xe605;</i>
  166. <div class="name">斜箭头</div>
  167. <div class="code">&amp;#xe605;</div>
  168. </li>
  169. <li>
  170. <i class="icon iconflow">&#xe678;</i>
  171. <div class="name">配置</div>
  172. <div class="code">&amp;#xe678;</div>
  173. </li>
  174. <li>
  175. <i class="icon iconflow">&#xe872;</i>
  176. <div class="name">项目组合</div>
  177. <div class="code">&amp;#xe872;</div>
  178. </li>
  179. <li>
  180. <i class="icon iconflow">&#xe68f;</i>
  181. <div class="name">系统参数配置</div>
  182. <div class="code">&amp;#xe68f;</div>
  183. </li>
  184. <li>
  185. <i class="icon iconflow">&#xe663;</i>
  186. <div class="name">区块</div>
  187. <div class="code">&amp;#xe663;</div>
  188. </li>
  189. <li>
  190. <i class="icon iconflow">&#xe60c;</i>
  191. <div class="name">分支</div>
  192. <div class="code">&amp;#xe60c;</div>
  193. </li>
  194. <li>
  195. <i class="icon iconflow">&#xe60d;</i>
  196. <div class="name">01</div>
  197. <div class="code">&amp;#xe60d;</div>
  198. </li>
  199. <li>
  200. <i class="icon iconflow">&#xe60e;</i>
  201. <div class="name">02</div>
  202. <div class="code">&amp;#xe60e;</div>
  203. </li>
  204. </ul>
  205. <h2 id="unicode-">unicode引用</h2>
  206. <hr>
  207. <p>unicode是字体在网页端最原始的应用方式,特点是:</p>
  208. <ul>
  209. <li>兼容性最好,支持ie6+,及所有现代浏览器。</li>
  210. <li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
  211. <li>但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。</li>
  212. </ul>
  213. <blockquote>
  214. <p>注意:新版iconfont支持多色图标,这些多色图标在unicode模式下将不能使用,如果有需求建议使用symbol的引用方式</p>
  215. </blockquote>
  216. <p>unicode使用步骤如下:</p>
  217. <h3 id="-font-face">第一步:拷贝项目下面生成的font-face</h3>
  218. <pre><code class="lang-js hljs javascript">@font-face {
  219. font-family: <span class="hljs-string">'iconflow'</span>;
  220. src: url(<span class="hljs-string">'iconfont.eot'</span>);
  221. src: url(<span class="hljs-string">'iconfont.eot?#iefix'</span>) format(<span class="hljs-string">'embedded-opentype'</span>),
  222. url(<span class="hljs-string">'iconfont.woff'</span>) format(<span class="hljs-string">'woff'</span>),
  223. url(<span class="hljs-string">'iconfont.ttf'</span>) format(<span class="hljs-string">'truetype'</span>),
  224. url(<span class="hljs-string">'iconfont.svg#iconflow'</span>) format(<span class="hljs-string">'svg'</span>);
  225. }
  226. </code></pre>
  227. <h3 id="-iconfont-">第二步:定义使用iconfont的样式</h3>
  228. <pre><code class="lang-js hljs javascript">.iconflow{
  229. font-family:<span class="hljs-string">"iconflow"</span> !important;
  230. font-size:<span class="hljs-number">16</span>px;font-style:normal;
  231. -webkit-font-smoothing: antialiased;
  232. -webkit-text-stroke-width: <span class="hljs-number">0.2</span>px;
  233. -moz-osx-font-smoothing: grayscale;
  234. }
  235. </code></pre>
  236. <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
  237. <pre><code class="lang-js hljs javascript">&lt;i <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"iconflow"</span>&gt;&amp;#x33;<span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span></span></code></pre>
  238. <blockquote>
  239. <p>"iconflow"是你项目下的font-family。可以通过编辑项目查看,默认是"iconfont"。</p>
  240. </blockquote>
  241. </div>
  242. </body>
  243. </html>