<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>盒模型</title>
</head>
<body>
<header>header</header>
<aside calss="letf">left</aside>
<main>main</main>
<aside calss="right">right</aside>
<footer>footer</footer>
<style>
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
display: grid;
grid-template-rows: 2em minmax(20em,30em) 2em;
grid-template-columns: 6em 1fr 6em;
}
header,footer{
background-color: yellow;
grid-column: span 3;
}
main{
background-color: cyan;
}
aside {
background-color: lightblue;
}
main{
background-color: green;
}
/* rem+vw进行布局,移动端不运行出现px,有px to rem的插件 */
</style>
</body>
</html>