Blogger Information
Blog 18
fans 0
comment 3
visits 12469
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
一个我的电脑按钮在不同分辨率的设备屏幕下如何显示不同大小
P粉019280626
Original
344 people have browsed it
  1. 用媒体查询,设置不同设备下屏幕大小
  2. <!DOCTYPE html>
  3. <html lang="zh-CN">
  4. <head>
  5. <meta charset="UTF-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>媒体查询--我的电脑按钮</title>
  9. </head>
  10. <body>
  11. <button class="btn xiaode">我的电脑小</button>
  12. <button class="btn zhongde">我的电脑中</button>
  13. <button class="btn dade">我的电脑大</button>
  14. <style>
  15. html {font-size:0.625rem;}
  16. .btn {
  17. background-color:darkblue;
  18. color:blanchedalmond;
  19. border:none;
  20. }
  21. .btn:hover{
  22. cursor:pointer;
  23. opacity:0.8;
  24. transition:0.3s;
  25. }
  26. /* 设置默认下字体大小 */
  27. .btn.xiaode{
  28. font-size:1.2rem;
  29. }
  30. .btn.zhongde{
  31. font-size:1.5rem;
  32. }
  33. .btn.dade{
  34. font-size:2rem;
  35. }
  36. /* 再设置不同宽度下的显示大小 */
  37. @media (max-width:375px) {
  38. html {
  39. font-size:14px; }
  40. }
  41. @media (min-width:375px) and (min-width:600px) {
  42. html{
  43. font-size:16px;}
  44. }
  45. @media (min-width:600px){
  46. html{
  47. font-size:22px;}
  48. }
  49. </style>
  50. </body>
  51. </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