Blogger Information
Blog 46
fans 2
comment 0
visits 19462
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
实例演示移动端布局原理
P粉314265155
Original
823 people have browsed it

效果

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. <link rel="stylesheet" href="../0715/static/css/zuoye1.css">
  8. <title>移动端自适用</title>
  9. <link rel="stylesheet" href="">
  10. </head>
  11. <body>
  12. <div class="box">Hello World</div>
  13. </body>
  14. </html>

css

  1. *
  2. {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. html {
  8. font-size: larger;
  9. font-size: calc(100vw / 3.75);
  10. }
  11. body {
  12. /* font-size: 16px; */
  13. /* font-size: 0.16rem; */
  14. }
  15. @media (max-width:375px ) {
  16. html {
  17. font-size: 87.5px
  18. }
  19. }
  20. @media (min-width:470px ) {
  21. html {
  22. font-size: 125px;
  23. }
  24. }
  25. @media (min-width:376px ) and (max-width:469px ) {
  26. html {
  27. font-size: 60px;
  28. }
  29. }
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!