Blogger Information
Blog 12
fans 0
comment 0
visits 3504
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
字体图标的使用
len
Original
308 people have browsed it

程序实现

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>字体图标的使用</title>
  8. <link
  9. rel="stylesheet"
  10. href="//at.alicdn.com/t/c/font_3958903_50kcu2wlrhj.css"
  11. />
  12. </head>
  13. <style>
  14. * {
  15. box-sizing: border-box;
  16. padding: 0;
  17. margin: 0;
  18. }
  19. .icon-a-business-icon-Bigpromotion {
  20. color: aqua;
  21. font-size: 2em;
  22. /* margin-left: 100px; */
  23. }
  24. .icon-cart-empty,
  25. .icon-cart-empty-fill {
  26. color: skyblue;
  27. font-size: 2em;
  28. }
  29. .empty {
  30. font-size: 14px;
  31. }
  32. .catalog {
  33. color: green;
  34. font-size: 2rem;
  35. }
  36. html {
  37. font-size: 18px;
  38. }
  39. .icon-customer-businessman-fill:hover {
  40. color: red;
  41. cursor: pointer;
  42. font-size: 2em;
  43. transition: 0.3s;
  44. }
  45. .icon-hot-for-ux-fill:hover {
  46. display: inline-block;
  47. width: 20vw;
  48. height: 20vh;
  49. transition: 2s;
  50. background-color: lightgreen;
  51. cursor: pointer;
  52. }
  53. </style>
  54. <body>
  55. <ul>
  56. <li class="business">
  57. <span class="iconfont icon-a-business-icon-Bigpromotion">business</span>
  58. </li>
  59. <li class="cart empty">
  60. <span class="iconfont icon-cart-empty">cart empty</span>
  61. </li>
  62. <li class="cart fill">
  63. <span class="iconfont icon-cart-empty-fill">cart full</span>
  64. </li>
  65. <li class="catalog">
  66. <span class="iconfont icon-catalog">catalog</span>
  67. </li>
  68. <li class="businessman">
  69. <span class="iconfont icon-customer-businessman-fill">businessman</span>
  70. </li>
  71. <li class="hot fill">
  72. <span class="iconfont icon-hot-for-ux-fill">hot fill</span>
  73. </li>
  74. <li class="hot atmosphere">
  75. <span class="iconfont icon-hot-for-atmosphere">hot atmosphere</span>
  76. </li>
  77. </ul>
  78. </body>
  79. </html>

效果图

效果1

字体图标效果1

效果2

字体图标效果2


注意点

  • font-size 不能被继承
  • 如果iconfont.cn网站上项目删了,是不是图标就失效了?
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post