登录  /  注册
博主信息
博文 38
粉丝 0
评论 0
访问量 28659
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
插入字体图标
一个好人
原创
1028人浏览过
  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>case</title>
  8. <link rel="stylesheet" href="icon.css">
  9. </head>
  10. <body>
  11. <div class="box parent">
  12. <div class="box child">
  13. <span class="iconfont icon-elment index"></span>
  14. <span class="iconfont icon-quanbudingdan order"></span>
  15. <span class="iconfont icon-31wode my"></span>
  16. </div>
  17. </div>
  18. </body>
  19. </html>
  20. ``````css
  21. @import url('https://at.alicdn.com/t/c/font_3958347_byfo5e0zz4n.css');
  22. .box{
  23. border: 1px solid blue;![三个字体图标](https://img.php.cn/upload/image/190/275/596/1679050213821360.png "三个字体图标")
  24. background-color: lightgrey;
  25. }
  26. .box.parent{
  27. width: 420px;
  28. }
  29. .box.child{
  30. width: 375px;
  31. height: 800rem;
  32. margin-left: auto;
  33. margin-right: auto;
  34. margin-top: 20px;
  35. border: none;
  36. }
  37. .index{
  38. opacity: 0.6;
  39. font-size: 2rem;
  40. color: #707070;
  41. margin-top: 20px;
  42. margin-left: 1rem;
  43. }
  44. .order{
  45. opacity: 0.6;
  46. font-size: 2rem;
  47. color: #707070;
  48. margin-top: 20px;
  49. margin-left: 0.7em;
  50. margin-right: 0.7em;
  51. }
  52. .my{
  53. opacity: 0.6;
  54. font-size: 2rem;
  55. color: #707070;
  56. margin-top: 20px;
  57. /* margin-left: 16px; */
  58. margin-right: 16px;
  59. }
  60. .iconfont:hover{
  61. opacity: 1;
  62. font-size: 2.2rem;
  63. color: #00aaff;
  64. cursor: pointer;
  65. transition: 0.3s;
  66. }
  67. @media (max-width:500px) {
  68. html{
  69. font-size: 1.8rem;
  70. }
  71. }
  72. @media (min-width:500px) and (max-width:800px){
  73. html{
  74. font-size: 2rem;
  75. }
  76. }
  77. @media (min-width:800px) {
  78. html{
  79. font-size: 2.5rem;
  80. }
  81. }

插入3个字体图标

字体图标

图标选中后变亮

字体图标2

屏幕宽度499px时图标高度63.33px

字体图标3

屏幕宽度500px时图标高度70px

字体图标4

总结:

字体图标挺有趣的,应该再介绍一下下载后插入字体图标的方法。

批改老师:PHPzPHPz

批改状态:合格

老师批语:
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学