Blogger Information
Blog 56
fans 0
comment 4
visits 38118
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
CSS:盒模型-复习
异乡客
Original
543 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. </head>
  9. <body>
  10. <!-- <div class="box"> -->
  11. <div class="box1">
  12. </div>
  13. <style>
  14. .box {
  15. /* em绑定当年或父级的font-size */
  16. /* width: 160px; */
  17. font-size: 10px;
  18. width: 10em;
  19. height: 150px;
  20. border: 3px solid red;
  21. box-sizing: border-box;
  22. }
  23. .box2{
  24. /* rem永远和html中的fontsize绑定 */
  25. font-size: 10px;
  26. width: 10rem;
  27. height: 150px;
  28. border: 3px solid red;
  29. box-sizing: border-box;
  30. }
  31. .box1{
  32. /* vh,vm */
  33. /* vm可视窗口宽度的1%, vh可视窗口的高度的1% */
  34. width: 50vw;
  35. height: 30vh;
  36. background-color: red;
  37. }
  38. </style>
  39. </body>
  40. </html>
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