demo_unicode.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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">&#xe601;</i>
  31. <div class="name">add</div>
  32. <div class="code">&amp;#xe601;</div>
  33. </li>
  34. <li>
  35. <i class="icon iconfont">&#xe604;</i>
  36. <div class="name">gongdan2</div>
  37. <div class="code">&amp;#xe604;</div>
  38. </li>
  39. <li>
  40. <i class="icon iconfont">&#xe605;</i>
  41. <div class="name">gongdan</div>
  42. <div class="code">&amp;#xe605;</div>
  43. </li>
  44. <li>
  45. <i class="icon iconfont">&#xe606;</i>
  46. <div class="name">home</div>
  47. <div class="code">&amp;#xe606;</div>
  48. </li>
  49. <li>
  50. <i class="icon iconfont">&#xe607;</i>
  51. <div class="name">more</div>
  52. <div class="code">&amp;#xe607;</div>
  53. </li>
  54. <li>
  55. <i class="icon iconfont">&#xe608;</i>
  56. <div class="name">message</div>
  57. <div class="code">&amp;#xe608;</div>
  58. </li>
  59. <li>
  60. <i class="icon iconfont">&#xe60a;</i>
  61. <div class="name">peo2</div>
  62. <div class="code">&amp;#xe60a;</div>
  63. </li>
  64. <li>
  65. <i class="icon iconfont">&#xe60c;</i>
  66. <div class="name">people</div>
  67. <div class="code">&amp;#xe60c;</div>
  68. </li>
  69. <li>
  70. <i class="icon iconfont">&#xe60d;</i>
  71. <div class="name">peo3</div>
  72. <div class="code">&amp;#xe60d;</div>
  73. </li>
  74. <li>
  75. <i class="icon iconfont">&#xe60f;</i>
  76. <div class="name">search</div>
  77. <div class="code">&amp;#xe60f;</div>
  78. </li>
  79. <li>
  80. <i class="icon iconfont">&#xe611;</i>
  81. <div class="name">sort1</div>
  82. <div class="code">&amp;#xe611;</div>
  83. </li>
  84. <li>
  85. <i class="icon iconfont">&#xe613;</i>
  86. <div class="name">start</div>
  87. <div class="code">&amp;#xe613;</div>
  88. </li>
  89. <li>
  90. <i class="icon iconfont">&#xe614;</i>
  91. <div class="name">start 2</div>
  92. <div class="code">&amp;#xe614;</div>
  93. </li>
  94. <li>
  95. <i class="icon iconfont">&#xe615;</i>
  96. <div class="name">安全参数</div>
  97. <div class="code">&amp;#xe615;</div>
  98. </li>
  99. <li>
  100. <i class="icon iconfont">&#xe619;</i>
  101. <div class="name">当前报警</div>
  102. <div class="code">&amp;#xe619;</div>
  103. </li>
  104. <li>
  105. <i class="icon iconfont">&#xe61a;</i>
  106. <div class="name">环境</div>
  107. <div class="code">&amp;#xe61a;</div>
  108. </li>
  109. <li>
  110. <i class="icon iconfont">&#xe61b;</i>
  111. <div class="name">环境logo</div>
  112. <div class="code">&amp;#xe61b;</div>
  113. </li>
  114. <li>
  115. <i class="icon iconfont">&#xe61d;</i>
  116. <div class="name">会员满意度</div>
  117. <div class="code">&amp;#xe61d;</div>
  118. </li>
  119. <li>
  120. <i class="icon iconfont">&#xe620;</i>
  121. <div class="name">监测点</div>
  122. <div class="code">&amp;#xe620;</div>
  123. </li>
  124. <li>
  125. <i class="icon iconfont">&#xe622;</i>
  126. <div class="name">冷站logo</div>
  127. <div class="code">&amp;#xe622;</div>
  128. </li>
  129. <li>
  130. <i class="icon iconfont">&#xe623;</i>
  131. <div class="name">能源logo</div>
  132. <div class="code">&amp;#xe623;</div>
  133. </li>
  134. <li>
  135. <i class="icon iconfont">&#xe624;</i>
  136. <div class="name">评分</div>
  137. <div class="code">&amp;#xe624;</div>
  138. </li>
  139. <li>
  140. <i class="icon iconfont">&#xe625;</i>
  141. <div class="name">配电logo</div>
  142. <div class="code">&amp;#xe625;</div>
  143. </li>
  144. <li>
  145. <i class="icon iconfont">&#xe626;</i>
  146. <div class="name">趋势</div>
  147. <div class="code">&amp;#xe626;</div>
  148. </li>
  149. <li>
  150. <i class="icon iconfont">&#xe627;</i>
  151. <div class="name">强电专业系统</div>
  152. <div class="code">&amp;#xe627;</div>
  153. </li>
  154. <li>
  155. <i class="icon iconfont">&#xe629;</i>
  156. <div class="name">生活热水</div>
  157. <div class="code">&amp;#xe629;</div>
  158. </li>
  159. <li>
  160. <i class="icon iconfont">&#xe62b;</i>
  161. <div class="name">项目打分表</div>
  162. <div class="code">&amp;#xe62b;</div>
  163. </li>
  164. <li>
  165. <i class="icon iconfont">&#xe62d;</i>
  166. <div class="name">空状态icon</div>
  167. <div class="code">&amp;#xe62d;</div>
  168. </li>
  169. <li>
  170. <i class="icon iconfont">&#xe62e;</i>
  171. <div class="name">统计分析blue</div>
  172. <div class="code">&amp;#xe62e;</div>
  173. </li>
  174. <li>
  175. <i class="icon iconfont">&#xe62f;</i>
  176. <div class="name">预警</div>
  177. <div class="code">&amp;#xe62f;</div>
  178. </li>
  179. <li>
  180. <i class="icon iconfont">&#xe631;</i>
  181. <div class="name">总览</div>
  182. <div class="code">&amp;#xe631;</div>
  183. </li>
  184. <li>
  185. <i class="icon iconfont">&#xe632;</i>
  186. <div class="name">租赁logo</div>
  187. <div class="code">&amp;#xe632;</div>
  188. </li>
  189. <li>
  190. <i class="icon iconfont">&#xe616;</i>
  191. <div class="name">账号</div>
  192. <div class="code">&amp;#xe616;</div>
  193. </li>
  194. <li>
  195. <i class="icon iconfont">&#xe617;</i>
  196. <div class="name">close</div>
  197. <div class="code">&amp;#xe617;</div>
  198. </li>
  199. <li>
  200. <i class="icon iconfont">&#xe618;</i>
  201. <div class="name">密码</div>
  202. <div class="code">&amp;#xe618;</div>
  203. </li>
  204. <li>
  205. <i class="icon iconfont">&#xe602;</i>
  206. <div class="name">meos</div>
  207. <div class="code">&amp;#xe602;</div>
  208. </li>
  209. </ul>
  210. <h2 id="unicode-">unicode引用</h2>
  211. <hr>
  212. <p>unicode是字体在网页端最原始的应用方式,特点是:</p>
  213. <ul>
  214. <li>兼容性最好,支持ie6+,及所有现代浏览器。</li>
  215. <li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
  216. <li>但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。</li>
  217. </ul>
  218. <blockquote>
  219. <p>注意:新版iconfont支持多色图标,这些多色图标在unicode模式下将不能使用,如果有需求建议使用symbol的引用方式</p>
  220. </blockquote>
  221. <p>unicode使用步骤如下:</p>
  222. <h3 id="-font-face">第一步:拷贝项目下面生成的font-face</h3>
  223. <pre><code class="lang-js hljs javascript">@font-face {
  224. font-family: <span class="hljs-string">'iconfont'</span>;
  225. src: url(<span class="hljs-string">'iconfont.eot'</span>);
  226. src: url(<span class="hljs-string">'iconfont.eot?#iefix'</span>) format(<span class="hljs-string">'embedded-opentype'</span>),
  227. url(<span class="hljs-string">'iconfont.woff'</span>) format(<span class="hljs-string">'woff'</span>),
  228. url(<span class="hljs-string">'iconfont.ttf'</span>) format(<span class="hljs-string">'truetype'</span>),
  229. url(<span class="hljs-string">'iconfont.svg#iconfont'</span>) format(<span class="hljs-string">'svg'</span>);
  230. }
  231. </code></pre>
  232. <h3 id="-iconfont-">第二步:定义使用iconfont的样式</h3>
  233. <pre><code class="lang-js hljs javascript">.iconfont{
  234. font-family:<span class="hljs-string">"iconfont"</span> !important;
  235. font-size:<span class="hljs-number">16</span>px;font-style:normal;
  236. -webkit-font-smoothing: antialiased;
  237. -webkit-text-stroke-width: <span class="hljs-number">0.2</span>px;
  238. -moz-osx-font-smoothing: grayscale;
  239. }
  240. </code></pre>
  241. <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
  242. <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>
  243. <blockquote>
  244. <p>"iconfont"是你项目下的font-family。可以通过编辑项目查看,默认是"iconfont"。</p>
  245. </blockquote>
  246. </div>
  247. </body>
  248. </html>