面试题-css标准盒模型和怪异盒模型
标准盒模型,宽度width = content +padding +boder
怪异盒模型:width = width,会去挤压内容
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>盒模型</title> <style> /* w3c : width = content +padding +boder IE : width = width */ * { padding: 0; margin: 0; } div { width: 200px; height: 200px; background-color: aqua; padding: 0 10px; margin: 0 20px; border: 5px solid #ccc; box-sizing: border-box; } </style> </head> <body> <div>test 盒模型</div> </body> </html>