Blogger Information
Blog 94
fans 0
comment 0
visits 92706
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
【CSS】字体图标-引入第三方字体和图标:阿里图标字体
可乐随笔
Original
393 people have browsed it

字体图标

1. 字体图标

  1. - 阿里图标 <https://www.icofont.cn>
  2. - Unicode, class
  3. /*=============================================
  4. = 一、Unicode =
  5. =============================================*/
  6. /* 1.安装自定义图标字体 */
  7. /* CDN 服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
  8. @font-face {
  9. /* 字体名称 */
  10. font-family: 'iconfont'; /* Project id 3778676 */
  11. /* 字体文件路径,可以是远程的,也可以是本地的 */
  12. src: url('//at.alicdn.com/t/c/font_3778676_xrrqstydj5.woff2?t=1668742255577') format('woff2'),
  13. url('//at.alicdn.com/t/c/font_3778676_xrrqstydj5.woff?t=1668742255577') format('woff'),
  14. url('//at.alicdn.com/t/c/font_3778676_xrrqstydj5.ttf?t=1668742255577') format('truetype');
  15. }
  16. /* 安装自定义字体 */
  17. @font-face {
  18. font-family: 'font-name';
  19. src: url('url');
  20. }
  21. /* 2. 声明自定义字体图标样式 */
  22. /* unicode */
  23. .iconfont.unicode {
  24. /* 必须先声明自定义的字体名称 */
  25. font-family: iconfont;
  26. font-size: large;
  27. color: green;
  28. text-shadow: #888;
  29. }
  30. /* class 最流行 */
  31. .iconfont.class {
  32. font-size: x-large;
  33. color: violet;
  34. }
  35. .iconfont.class:hover {
  36. font-size: x-large;
  37. color: red;
  38. transition: color 0.5s linear;
  39. }

HTML示例代码

  1. <!DOCTYPE html>
  2. <html lang="en">
  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>Document</title>
  8. <!-- Unicode -->
  9. <link rel="stylesheet" href="css/font-icon.css">
  10. <!-- class -->
  11. <link rel="stylesheet" href="//at.alicdn.com/t/c/font_3778676_ydklqqrp7es.css">
  12. </head>
  13. <body>
  14. <!-- 1. Unicode -->
  15. <div class="iconfont unicode">
  16. <span>&#xe600;</span>
  17. </div>
  18. <hr>
  19. <!-- 2. class -->
  20. <div class="iconfont class">
  21. <span class="icon-shezhi"></span>
  22. <span class="icon-zhuce"></span>
  23. </div>
  24. </body>
  25. </html>
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