Blogger Information
Blog 12
fans 0
comment 2
visits 6210
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
字体图标的引用及媒体查询
白鸽
Original
796 people have browsed it

字体图标的引用及媒体查询

媒体查询由小屏幕到大屏幕查询效果如下。
1
2

" class="reference-link">3

html代码如下

  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. html{
  10. font-size: 64px;
  11. }
  12. /* 体验使用下载图标的方式,先引用下载图标的字体文件 */
  13. @font-face {
  14. font-family: "iconfont";
  15. src: url('iconfont.woff2') format('woff2'),
  16. url('iconfont.woff') format('woff'),
  17. url('iconfont.ttf') format('truetype');
  18. }
  19. .iconfont {
  20. font-family: "iconfont" !important;
  21. font-size: 1rem;
  22. font-style: normal;
  23. -webkit-font-smoothing: antialiased;
  24. -moz-osx-font-smoothing: grayscale;
  25. }
  26. .icon-tuichudenglu:before {
  27. content: "\e6cf";
  28. }
  29. .icon-shezhi:before {
  30. content: "\e6d8";
  31. }
  32. .icon-shouye:before {
  33. content: "\e6fa";
  34. }
  35. .icon-wode:before {
  36. content: "\e6fb";
  37. }
  38. /* 字体文件设置引入完毕 */
  39. @media (max-width: 374px) {
  40. html {
  41. font-size: 16px;
  42. }
  43. }
  44. @media (min-width: 375px) and (max-width: 768px) {
  45. html {
  46. font-size: 32px;
  47. }
  48. }
  49. @media (min-width: 768px) {
  50. html {
  51. font-size: 64px;
  52. }
  53. }
  54. </style>
  55. </head>
  56. <body>
  57. <div>
  58. <p><span class="iconfont icon-shouye"></span>&nbsp;&nbsp;&nbsp;&nbsp;
  59. <span class="iconfont icon-tuichudenglu"></span>&nbsp;&nbsp;&nbsp;&nbsp;
  60. <span class="iconfont icon-shezhi"></span>&nbsp;&nbsp;&nbsp;&nbsp;
  61. <span class="iconfont icon-wode"></span></p>
  62. </div>
  63. </body>
  64. </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!