让我们了解CSS2调整大小属性和CSS3框调整大小属性之间的区别。
<html> <head> <style> .div1 { width: 200px; height: 100px; border: 1px solid green; } .div2 { width: 200px; height: 100px; padding: 50px; border: 1px solid pink; } </style> </head> <body> <div class = "div1">nhooo.com</div></br> <div class = "div2">nhooo.com</div> </body> </html>
<html> <head> <style> .div1 { width: 300px; height: 100px; border: 1px solid blue; box-sizing: border-box; } .div2 { width: 300px; height: 100px; padding: 50px; border: 1px solid red; box-sizing: border-box; } </style> </head> <body> <div class = "div1">nhooo.com</div></br> <div class = "div2">nhooo.com</div> </body> </html>