Blogger Information
Blog 14
fans 0
comment 0
visits 23825
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
"class"使用图标以及媒体查询原理
逍遥php
Original
400 people have browsed it

1 Class使用图标

1.1 图标下载

  1. -阿里图标:'https://www.iconfont.cn/'

1.2 代码

  1. <!-- 引入图标库 -->
  2. <link rel="stylesheet" href="//at.alicdn.com/t/c/font_2952236_8q6uhlh6i1r.css" />
  1. <div>
  2. <span class="icon-gouwucheman"></span>
  3. <span class="icon-31wode"></span>
  4. </div>

效果图展示

媒体查询原理

代码

  1. <!-- 媒体:屏幕,手机,打印机 -->
  2. <!-- 查询: 查询媒体宽度来确定元素展示方式 -->
  3. <!-- 布局的前提:
  4. 1.布局不能在一个无限空间进行,宽,高必须限定一个
  5. 2.默认限定宽高,而高度随内容不断增长 -->
  6. <button class="btn small">按钮1</button>
  7. <button class="btn middle">按钮2</button>
  8. <button class="btn large">按钮3</button>

css

  1. /* 媒体查询 */
  2. /* < 375px ,1rem = 12px */
  3. @media (max-width: 375px) {
  4. html {
  5. font-size: 12px;
  6. }
  7. }
  8. /* 375px-415px 1rem=14px */
  9. @media (min-width: 375px) and (max-width: 414px) {
  10. html {
  11. font-size: 14px;
  12. }
  13. }
  14. /* > 415px :1rem=16px */
  15. @media (max-width: 415px) {
  16. html {
  17. font-size: 16px;
  18. }
  19. }
  20. /* 媒体查询的宽度顺序:移动端:1.从小往大写
  21. 2.PC端反方向写
  22. */

总结

  1. 1.如果是判断最小值 (min-width),那么就应该从小到大写--bootstrap就是判断最小值,从小到大写
  2. 2.如果是判断最大值 (max-width),那么就应该从大到小写
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