12345678910111213141516171819202122232425262728293031 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
- div {
- width: 220px;
- height: 220px;
- background: #00f;
- border: 3px solid #0f0;
- padding: 20px;
- margin: 10px;
- box-sizing: content-box;
- }
- /*
- 盒模型:
- 标准盒模型:
- box-sizing:content-box
- 宽度 = 内容宽度 + 边框 + 内边距
- 怪异盒模型(IE盒模型):
- box-sizing:border-box
- 宽度 = 内容宽度(弹性的witdh + 边框 + 内边距 )
- */
- </style>
- </head>
- <body>
- <div></div>
- </body>
- </html>
|