Blogger Information
Blog 10
fans 0
comment 0
visits 7984
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
box-sizing的意义(两种区别)
php还在初学
Original
875 people have browsed it
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>box-sizing的意义</title>
  7. </head>
  8. <style>
  9. .box1 {
  10. width: 200px;
  11. height: 200px;
  12. padding: 20px;
  13. margin: auto;
  14. box-sizing: content-box;
  15. background-color: darkslateblue;
  16. }
  17. .box2 {
  18. width: 200px;
  19. height: 200px;
  20. padding: 20px;
  21. margin: auto;
  22. box-sizing: border-box;
  23. background-color: rgb(169, 167, 187);
  24. }
  25. </style>
  26. <body>
  27. <div class="box1"></div>
  28. <div class="box2"></div>
  29. </body>
  30. </html>

二者区别效果图:

Correcting teacher:天蓬老师天蓬老师

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