Blogger Information
Blog 62
fans 3
comment 1
visits 29543
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
阿里字体图标使用写法与响应式代码
kiraseo_wwwkiraercom
Original
474 people have browsed it

引入阿里图标

案例代码

  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="css/zuoye1.css">
  9. </head>
  10. <body>
  11. <!--使用大尺寸font-size-b-->
  12. <span class="iconfont icon-icon-wangluo font-size-b">111</span>
  13. <!--使用小尺寸font-size-s-->
  14. <span class="iconfont icon-icon-wangluo font-size-s">111</span>
  15. </body>
  16. </html>
  1. <--zuoye1.css-->
  2. //引入字体库文件的css
  3. @import url('font_icon/iconfont.css');
  4. //自定义尺寸
  5. //大尺寸
  6. .font-size-b{
  7. font-size: 35px;
  8. color: red;
  9. }
  10. //小尺寸
  11. .font-size-s{
  12. font-size: 10px;
  13. color: red;
  14. }

效果图

效果图

响应式代码

案例代码

  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="css/zuoye.css">
  9. </head>
  10. <body>
  11. <button class="btn small">btn1</button>
  12. <button class="btn middle">btn2</button>
  13. <button class="btn large">btn3</button>
  14. </body>
  15. </html>
  1. <--zuoye.css-->
  2. html{font-size: 10px;}
  3. .btn{outline: none;border: none;color: white;background-color: seagreen;}
  4. .small{ font-size: 1.2rem;}
  5. .middle{font-size: 1.6rem;}
  6. .large{font-size: 2rem;}
  7. /* 大屏幕 :大于等于1200px*/
  8. @media (min-width: 1200px) {
  9. html{ font-size: 80px;}
  10. }
  11. /*默认*/
  12. @media (min-width: 980px){
  13. html{font-size: 60px; }
  14. }
  15. /* 平板电脑和小屏电脑之间的分辨率 */
  16. @media (min-width: 768px) and (max-width: 979px) {
  17. html{ font-size: 50px; }
  18. }
  19. /* 横向放置的手机和竖向放置的平板之间的分辨率 */
  20. @media (max-width: 767px) {
  21. html{font-size: 40px;}
  22. }
  23. /* 横向放置的手机及分辨率更小的设备 */
  24. @media (max-width: 480px) {
  25. html{font-size: 30px;}
  26. }

效果图

效果图

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