Blogger Information
Blog 20
fans 0
comment 0
visits 8585
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1025作业,阿里矢量图的使用
A 管志岗-电商策划
Original
691 people have browsed it

实例演示字体的图标的使用,重点在class方式

  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. <!-- 阿里矢量图 class -->
  9. <link
  10. rel="stylesheet"
  11. href="//at.alicdn.com/t/font_2825039_dkubvn1ci8o.css"
  12. />
  13. </head>
  14. <body>
  15. <button class="btn small">按键1</button>
  16. <button class="btn middle">按键2</button>
  17. <button class="btn large">按键3</button>
  18. <!-- 演示class矢量图,用font class -->
  19. <!-- 块元素里面放入 iconfont class 才生效 -->
  20. <div class="iconfont class">
  21. <div class="icon-kefuzixunhui"></div>
  22. <div class="icon-zan"></div>
  23. </div>
  24. </body>
  25. <style>
  26. :root {
  27. font-size: 10px;
  28. }
  29. .btn {
  30. background-color: rgb(243, 38, 72);
  31. color: #fff;
  32. border: none;
  33. /* outline: none; */
  34. }
  35. .btn:hover {
  36. /* 移动显示小手 */
  37. cursor: pointer;
  38. /* 透明度 */
  39. opacity: 0.7;
  40. transition: 0.8s;
  41. }
  42. .btn.small {
  43. font-size: 1rem;
  44. }
  45. .btn.middle {
  46. font-size: 1.2rem;
  47. }
  48. .btn.large {
  49. font-size: 1.4rem;
  50. }
  51. /* 小于375px,1rem = 12px */
  52. @media (max-width: 375px) {
  53. :root {
  54. font-size: 12px;
  55. }
  56. }
  57. /* 大于375px切小于415px 1rem = 14px */
  58. @media (max-width: 415px) and (min-width: 375px) {
  59. :root {
  60. font-size: 14px;
  61. }
  62. }
  63. /* 给予大小宽度也可以用font-size来计算 */
  64. .icon-kefuzixunhui {
  65. font-size: 1.5rem;
  66. }
  67. </style>
  68. </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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!