Blogger Information
Blog 16
fans 0
comment 0
visits 5775
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
字体图标与媒体查询练习
Sinan学习博客
Original
306 people have browsed it

字体图标与媒体查询练习

1. 实例演示字体图标的引入与显示

使用阿里字体图标https://www.iconfont.cn/

  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. <style>
  9. /* 引入阿里图标文件 */
  10. @import url(//at.alicdn.com/t/c/font_3887880_49wqabhnxhs.css);
  11. .font-style{
  12. font-size:3em;
  13. color:rebeccapurple;
  14. }
  15. a {text-decoration: none;}
  16. </style>
  17. </head>
  18. <body>
  19. <div class="iconfont">
  20. <span class="icon-code font-style"></span>
  21. </div>
  22. <div class="iconfont font-style">
  23. <a href="#" class="icon-copy font-sytle"></a>
  24. </div>
  25. </body>
  26. </html>

2. 实例演示媒体查询(移动优先)

  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. <style>
  9. /* 移动端优先,由小屏到大屏 */
  10. @media (max-width: 375px) {
  11. /* 当屏幕宽度小于375px时,使用这里面的CSS规则 */
  12. h1{
  13. font-size:1em;
  14. }
  15. }
  16. @media (min-width: 375px) and (max-width: 640px) {
  17. /* 当屏幕宽度介于375px--640px之间时,使用这里的css规则 */
  18. h1{
  19. font-size:2em;
  20. }
  21. }
  22. @media (min-width: 640px) {
  23. /* 当屏幕大于640px时,使用这里面的CSS规则 */
  24. h1{
  25. font-size:3em;
  26. }
  27. }
  28. </style>
  29. </head>
  30. <body>
  31. <h1>大表哥</h1>
  32. </body>
  33. </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