demo_unicode.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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">&#xf007b;</i>
  31. <div class="name">统计分析</div>
  32. <div class="code">&amp;#xf007b;</div>
  33. </li>
  34. <li>
  35. <i class="icon iconfont">&#xe645;</i>
  36. <div class="name">下载</div>
  37. <div class="code">&amp;#xe645;</div>
  38. </li>
  39. <li>
  40. <i class="icon iconfont">&#xe601;</i>
  41. <div class="name">报名</div>
  42. <div class="code">&amp;#xe601;</div>
  43. </li>
  44. <li>
  45. <i class="icon iconfont">&#xe61a;</i>
  46. <div class="name">邮箱</div>
  47. <div class="code">&amp;#xe61a;</div>
  48. </li>
  49. <li>
  50. <i class="icon iconfont">&#xe632;</i>
  51. <div class="name">电话</div>
  52. <div class="code">&amp;#xe632;</div>
  53. </li>
  54. <li>
  55. <i class="icon iconfont">&#xe622;</i>
  56. <div class="name">人群</div>
  57. <div class="code">&amp;#xe622;</div>
  58. </li>
  59. <li>
  60. <i class="icon iconfont">&#xe62c;</i>
  61. <div class="name">新建文档</div>
  62. <div class="code">&amp;#xe62c;</div>
  63. </li>
  64. <li>
  65. <i class="icon iconfont">&#xe662;</i>
  66. <div class="name">钱</div>
  67. <div class="code">&amp;#xe662;</div>
  68. </li>
  69. <li>
  70. <i class="icon iconfont">&#xe7a9;</i>
  71. <div class="name">笑脸 满意 服务</div>
  72. <div class="code">&amp;#xe7a9;</div>
  73. </li>
  74. <li>
  75. <i class="icon iconfont">&#xe7f2;</i>
  76. <div class="name">箭头 下降</div>
  77. <div class="code">&amp;#xe7f2;</div>
  78. </li>
  79. <li>
  80. <i class="icon iconfont">&#xe6a6;</i>
  81. <div class="name">项目申报</div>
  82. <div class="code">&amp;#xe6a6;</div>
  83. </li>
  84. <li>
  85. <i class="icon iconfont">&#xe663;</i>
  86. <div class="name">人脉</div>
  87. <div class="code">&amp;#xe663;</div>
  88. </li>
  89. <li>
  90. <i class="icon iconfont">&#xe630;</i>
  91. <div class="name">公告</div>
  92. <div class="code">&amp;#xe630;</div>
  93. </li>
  94. <li>
  95. <i class="icon iconfont">&#xe72c;</i>
  96. <div class="name">箭头2-4</div>
  97. <div class="code">&amp;#xe72c;</div>
  98. </li>
  99. <li>
  100. <i class="icon iconfont">&#xe61d;</i>
  101. <div class="name">箭头_上</div>
  102. <div class="code">&amp;#xe61d;</div>
  103. </li>
  104. <li>
  105. <i class="icon iconfont">&#xe626;</i>
  106. <div class="name">锁</div>
  107. <div class="code">&amp;#xe626;</div>
  108. </li>
  109. <li>
  110. <i class="icon iconfont">&#xe74a;</i>
  111. <div class="name">交易性能</div>
  112. <div class="code">&amp;#xe74a;</div>
  113. </li>
  114. <li>
  115. <i class="icon iconfont">&#xe6c4;</i>
  116. <div class="name">简介</div>
  117. <div class="code">&amp;#xe6c4;</div>
  118. </li>
  119. <li>
  120. <i class="icon iconfont">&#xe633;</i>
  121. <div class="name">安全</div>
  122. <div class="code">&amp;#xe633;</div>
  123. </li>
  124. <li>
  125. <i class="icon iconfont">&#xe639;</i>
  126. <div class="name">数据</div>
  127. <div class="code">&amp;#xe639;</div>
  128. </li>
  129. <li>
  130. <i class="icon iconfont">&#xe623;</i>
  131. <div class="name">邮箱</div>
  132. <div class="code">&amp;#xe623;</div>
  133. </li>
  134. <li>
  135. <i class="icon iconfont">&#xe683;</i>
  136. <div class="name">注册</div>
  137. <div class="code">&amp;#xe683;</div>
  138. </li>
  139. <li>
  140. <i class="icon iconfont">&#xe629;</i>
  141. <div class="name">开标</div>
  142. <div class="code">&amp;#xe629;</div>
  143. </li>
  144. <li>
  145. <i class="icon iconfont">&#xe62e;</i>
  146. <div class="name">map</div>
  147. <div class="code">&amp;#xe62e;</div>
  148. </li>
  149. <li>
  150. <i class="icon iconfont">&#xe60c;</i>
  151. <div class="name">流程</div>
  152. <div class="code">&amp;#xe60c;</div>
  153. </li>
  154. <li>
  155. <i class="icon iconfont">&#xe634;</i>
  156. <div class="name">放大镜</div>
  157. <div class="code">&amp;#xe634;</div>
  158. </li>
  159. <li>
  160. <i class="icon iconfont">&#xe627;</i>
  161. <div class="name">电话</div>
  162. <div class="code">&amp;#xe627;</div>
  163. </li>
  164. <li>
  165. <i class="icon iconfont">&#xe60d;</i>
  166. <div class="name">二维码</div>
  167. <div class="code">&amp;#xe60d;</div>
  168. </li>
  169. <li>
  170. <i class="icon iconfont">&#xe617;</i>
  171. <div class="name">特色专题</div>
  172. <div class="code">&amp;#xe617;</div>
  173. </li>
  174. <li>
  175. <i class="icon iconfont">&#xe65b;</i>
  176. <div class="name">合作</div>
  177. <div class="code">&amp;#xe65b;</div>
  178. </li>
  179. <li>
  180. <i class="icon iconfont">&#xe625;</i>
  181. <div class="name">快捷标签</div>
  182. <div class="code">&amp;#xe625;</div>
  183. </li>
  184. <li>
  185. <i class="icon iconfont">&#xe621;</i>
  186. <div class="name">客服</div>
  187. <div class="code">&amp;#xe621;</div>
  188. </li>
  189. <li>
  190. <i class="icon iconfont">&#xe607;</i>
  191. <div class="name">天平</div>
  192. <div class="code">&amp;#xe607;</div>
  193. </li>
  194. <li>
  195. <i class="icon iconfont">&#xe7b6;</i>
  196. <div class="name">进行时钟</div>
  197. <div class="code">&amp;#xe7b6;</div>
  198. </li>
  199. <li>
  200. <i class="icon iconfont">&#xe66e;</i>
  201. <div class="name">透明度调节</div>
  202. <div class="code">&amp;#xe66e;</div>
  203. </li>
  204. <li>
  205. <i class="icon iconfont">&#xe611;</i>
  206. <div class="name">研究创新能力</div>
  207. <div class="code">&amp;#xe611;</div>
  208. </li>
  209. <li>
  210. <i class="icon iconfont">&#xe614;</i>
  211. <div class="name">数据安全</div>
  212. <div class="code">&amp;#xe614;</div>
  213. </li>
  214. <li>
  215. <i class="icon iconfont">&#xe60b;</i>
  216. <div class="name">搜索</div>
  217. <div class="code">&amp;#xe60b;</div>
  218. </li>
  219. <li>
  220. <i class="icon iconfont">&#xe63d;</i>
  221. <div class="name">报名成功</div>
  222. <div class="code">&amp;#xe63d;</div>
  223. </li>
  224. </ul>
  225. <h2 id="unicode-">unicode引用</h2>
  226. <hr>
  227. <p>unicode是字体在网页端最原始的应用方式,特点是:</p>
  228. <ul>
  229. <li>兼容性最好,支持ie6+,及所有现代浏览器。</li>
  230. <li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
  231. <li>但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。</li>
  232. </ul>
  233. <blockquote>
  234. <p>注意:新版iconfont支持多色图标,这些多色图标在unicode模式下将不能使用,如果有需求建议使用symbol的引用方式</p>
  235. </blockquote>
  236. <p>unicode使用步骤如下:</p>
  237. <h3 id="-font-face">第一步:拷贝项目下面生成的font-face</h3>
  238. <pre><code class="lang-js hljs javascript">@font-face {
  239. font-family: <span class="hljs-string">'iconfont'</span>;
  240. src: url(<span class="hljs-string">'iconfont.eot'</span>);
  241. src: url(<span class="hljs-string">'iconfont.eot?#iefix'</span>) format(<span class="hljs-string">'embedded-opentype'</span>),
  242. url(<span class="hljs-string">'iconfont.woff'</span>) format(<span class="hljs-string">'woff'</span>),
  243. url(<span class="hljs-string">'iconfont.ttf'</span>) format(<span class="hljs-string">'truetype'</span>),
  244. url(<span class="hljs-string">'iconfont.svg#iconfont'</span>) format(<span class="hljs-string">'svg'</span>);
  245. }
  246. </code></pre>
  247. <h3 id="-iconfont-">第二步:定义使用iconfont的样式</h3>
  248. <pre><code class="lang-js hljs javascript">.iconfont{
  249. font-family:<span class="hljs-string">"iconfont"</span> !important;
  250. font-size:<span class="hljs-number">16</span>px;font-style:normal;
  251. -webkit-font-smoothing: antialiased;
  252. -webkit-text-stroke-width: <span class="hljs-number">0.2</span>px;
  253. -moz-osx-font-smoothing: grayscale;
  254. }
  255. </code></pre>
  256. <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
  257. <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>
  258. <blockquote>
  259. <p>"iconfont"是你项目下的font-family。可以通过编辑项目查看,默认是"iconfont"。</p>
  260. </blockquote>
  261. </div>
  262. </body>
  263. </html>