<body>
<div id="wrap">
<header id="header"></header>
<nav id="nav"></nav>
<main id="main">
<aside id="aside"></aside>
<section id="section"></section>
<article id="article"></article>
</main>
<footer id="footer"></footer>
</div>
</body>
<!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>레이아웃 02</title>
<style>
* {
margin: 0;
padding: 0;
}
body {
background-color: #E8F5E9;
}
#wrap {
width: 1200px;
margin: 0 auto;
}
#header {
height: 100px;
background-color: #C8E6C9;
}
#nav {
height: 100px;
background-color: #A5D6A7;
}
#main {
display: grid;
grid-template-columns: 30% 40% 30%;
grid-template-rows: 780px ;
}
#aside {
background-color: #81C784;
}
#section {
background-color: #66BB6A;
}
#article {
background-color: #4CAF50;
}
#footer {
height: 100px;
background-color: #43A047;
}
/*미디어 쿼리*/
@media (max-width:1300px){
#wrap {
width: 96%;
}
}
@media (max-width :768px) {
#wrap {
width: 100%;
}
#main {
grid-template-areas:
"aside section"
"article article";
grid-template-columns: 30% 70%;
grid-template-rows: 580px 150px;
}
#aside {
grid-area: aside;
}
#section {
grid-area: section;
}
#article {
grid-area: article;
}
}
@media (max-width :480px) {
#main {
grid-template-areas:
"aside"
"section"
"article ";
grid-template-columns:100%;
grid-template-rows: 200px 430px 150px;
}
}
</style>
</head>
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.