Blogger Information
Blog 31
fans 0
comment 0
visits 14284
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
媒体查询,固定定位,flex属性
木子木杉
Original
531 people have browsed it

媒体查询

PC优先

  1. @media screen and (min-width: 750px) {
  2. html {
  3. font-size: 16px;
  4. }
  5. }
  6. @media screen and (min-width: 375px) and (max-width: 749px) {
  7. html {
  8. font-size: 14px;
  9. }
  10. }
  11. @media screen and (max-width: 374px) {
  12. html {
  13. font-size: 12px;
  14. }
  15. }

固定定位

登录页面

  1. <form action="" class="modal-form">
  2. <fieldset>
  3. <legend>用户登录</legend>
  4. <input type="email" name="emil" placeholder="username@email.com" />
  5. <input type="password" name="password" placeholder="******" />
  6. <button>登录</button>
  7. </fieldset>
  8. </form>

固定位置

  1. .modal .modal-form {
  2. position: fixed;
  3. top: 10em;
  4. left: 20em;
  5. right: 20em;
  6. }

flex 属性

1.flex-flow:主轴方向,不换行/换行

  1. flex-flow: row nowrap;
  2. flex-flow: row wrap;

2.place-content:项目在主轴上的排列与空间分配

  1. place-content: start;
  2. place-content: end;
  3. place-content: center;
  4. place-content: space-between;
  5. place-content: space-around;
  6. place-content: space-evenly;

3.place-item:项目在交叉轴上的对齐方式

  1. place-items: stretch;
  2. place-items: start;
  3. place-items: end;
  4. place-items: center;

4.flex:放大因子 收缩因子 计算宽度

  1. flex:auto;
  2. flex:1 1 auto;
  3. flex:0 1 auto;
  4. flex:0 0 auto;

5.order越小越靠前

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