demo.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <title>IconFont</title>
  6. <link rel="stylesheet" href="demo.css">
  7. <link rel="stylesheet" href="iconfont.css">
  8. </head>
  9. <body>
  10. <div class="main">
  11. <h1>IconFont 图标</h1>
  12. <ul class="icon_lists clear">
  13. <li>
  14. <i class="icon iconfont">&#xf0011;</i>
  15. <div class="name">首页</div>
  16. <div class="code">&amp;#xf0011;</div>
  17. <div class="fontclass">.shouye</div>
  18. </li>
  19. <li>
  20. <i class="icon iconfont">&#xe80e;</i>
  21. <div class="name">系统_设置</div>
  22. <div class="code">&amp;#xe80e;</div>
  23. <div class="fontclass">.xitongshezhi</div>
  24. </li>
  25. <li>
  26. <i class="icon iconfont">&#xe627;</i>
  27. <div class="name">详细内容介绍</div>
  28. <div class="code">&amp;#xe627;</div>
  29. <div class="fontclass">.xiangXiNeiRongJieShao</div>
  30. </li>
  31. <li>
  32. <i class="icon iconfont">&#xe61a;</i>
  33. <div class="name">会员</div>
  34. <div class="code">&amp;#xe61a;</div>
  35. <div class="fontclass">.huiyuan</div>
  36. </li>
  37. <li>
  38. <i class="icon iconfont">&#xe64b;</i>
  39. <div class="name">电视</div>
  40. <div class="code">&amp;#xe64b;</div>
  41. <div class="fontclass">.icondianshi</div>
  42. </li>
  43. </ul>
  44. <div class="helps">
  45. 第一步:使用font-face声明字体
  46. <pre>
  47. @font-face {font-family: 'iconfont';
  48. src: url('iconfont.eot'); /* IE9*/
  49. src: url('iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
  50. url('iconfont.woff') format('woff'), /* chrome、firefox */
  51. url('iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
  52. url('iconfont.svg#iconfont') format('svg'); /* iOS 4.1- */
  53. }
  54. </pre>
  55. 第二步:定义使用iconfont的样式
  56. <pre>
  57. .iconfont{
  58. font-family:"iconfont" !important;
  59. font-size:16px;font-style:normal;
  60. -webkit-font-smoothing: antialiased;
  61. -webkit-text-stroke-width: 0.2px;
  62. -moz-osx-font-smoothing: grayscale;}
  63. </pre>
  64. 第三步:挑选相应图标并获取字体编码,应用于页面
  65. <pre>
  66. &lt;i class="iconfont"&gt;&amp;#x33;&lt;/i&gt;
  67. </pre>
  68. </div>
  69. </div>
  70. </body>
  71. </html>