运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <head> <style> body { background-color:#E7E9EB; } #myDIV { height:300px; background-color:#FFFFFF; padding:30px; } #blueDIV { width:200px; border:30px solid coral; padding:10px; background-color:lightblue; box-sizing:border-box; } </style> </head> <body> <h1>The box-sizing Property</h1> <div id="myDIV"> <p>Below is a 200px DIV with 10px padding and a 30px border. If box-sizing is "border-box", the total width of the DIV element is always 200px, but if box-sizing is "content-box", the total width is 200px plus padding and border = 280px.</p> <div id="blueDIV">See what different box-sizing values does for an element.</div> </div> </body> </html>