博主信息
博文 21
粉丝 0
评论 0
访问量 17160
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
1025 字体的图标的使用,重点在class方式 2. 媒体查询原理,并描述媒体查询的顺序
放手去爱
原创
631人浏览过
  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>字体图标</title>
  8. <link rel="stylesheet" href="1025-01css.css" />
  9. <link
  10. rel="stylesheet"
  11. href="//at.alicdn.com/t/c/font_3735622_lqktuxdtoqp.css"
  12. />
  13. <style>
  14. :room {
  15. font-size: 10px;
  16. }
  17. /*
  18. 媒体查询
  19. 1rem = 10px , 1rem = 12px
  20. < 380px , 1rem = 12px
  21. 小于380px ,意思就是不大于380px
  22. */
  23. @media (max-width: 380px) {
  24. html {
  25. font-size: 10px;
  26. }
  27. }
  28. @media (min-width: 380px) and (max-width: 415px) {
  29. html {
  30. font-size: 12px;
  31. }
  32. }
  33. /* 媒体查询的宽度顺序:
  34. 1.移动端:从小往大写
  35. 2.PC端:从大往小写
  36. */
  37. .iconfont.class {
  38. font-size: x-large;
  39. color: red;
  40. display: inline-block;
  41. border: 1px solid #098;
  42. width: 5rem;
  43. }
  44. .iconfont.class span {
  45. font-size: 1.2rem;
  46. width: 5rem;
  47. display: block;
  48. text-align: center;
  49. }
  50. .iconfont.class .gouwusz {
  51. font-size:1.2rem;
  52. color: red;
  53. width: 5rem;
  54. }
  55. .iconfont.class span:hover {
  56. color: lightgreen;
  57. cursor: pointer;
  58. transition: color 0.5s linear;
  59. }
  60. </style>
  61. </head>
  62. <body>
  63. <!-- 字体图标 -->
  64. <!-- unicode -->
  65. <!-- <div class="iconfont unicode">
  66. <span>&#xe8b8;</span><span>&#xe622;</span>
  67. </div> -->
  68. <div class="iconfont class">
  69. <span class="icon-xingzhuanggongnengtubiao-"></span><span class="gouwusz">购物车</span>
  70. </div>
  71. <div class="iconfont class">
  72. <span class="icon-shezhi"></span></span><span class="gouwusz">设置</span>
  73. </div>
  74. </body>
  75. </html>

效果图1
效果图2

批改老师:PHPzPHPz

批改状态:合格

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

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

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