디자인
소개
- webstandard
- 01_layout
- 02_layout
- 03_layout
- layout02_01.html : 1. float으로 레이아웃 구성하기
- layout02_02.html : 2. float으로 레이아웃 구성하기 - 반응형
- layout02_03.html : 3. flex로 레이아웃 구성하기
- layout02_04.html : 4. flex로 레이아웃 구성하기 - 반응형
- layout02_05.html : 5. grid로 레이아웃 구성하기
- layout02_05.html : 6. grid로 레이아웃 구성하기 - 반응형
코드
<!DOCTYPE html>
<html lang="ko">
<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>레이아웃 유형03</title>
<style>
* {
margin: 0;
padding: 0;
}
body {
background-color: #E1F5FE;
}
#wrap {
width: 1200px;
margin: 0 auto;
}
#header {
width: 1200px;
height: 100px;
background-color: #B3E5FC;
}
#nav {
width: 1200px;
height: 100px;
background-color: #81D4FA;
}
#main {
width: 1200px;
}
#aside {
width: 300px;
height: 780px;
background-color: #4FC3F7;
float: left;
}
#article1 {
width: 900px;
height: 260px;
background-color: #29B6F6;
float: left;
}
#article2 {
width: 900px;
height: 260px;
background-color: #03A9F4;
float: left;
}
#article3 {
width: 900px;
height: 260px;
background-color: #039BE5;
float: left;
}
#footer {
width: 1200px;
height: 100px;
background-color: #0288D1;
}
/* clearfix */
.clearfix::before,
.clearfix::after {
content: '';
display: block;
line-height: 0;
}
.clearfix::after {
clear: both;
}
</style>
</head>
<body>
<div id="wrap">
<div id="header"></div>
<div id="nav"></div>
<div id="main" class="clearfix">
<div id="aside"></div>
<div id="article1"></div>
<div id="article2"></div>
<div id="article3"></div>
</div>
<div id="footer"></div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="ko">
<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>레이아웃 유형03</title>
<style>
* {
margin: 0;
padding: 0;
}
body {
background-color: #E1F5FE;
}
#wrap {
width: 1200px;
margin: 0 auto;
}
#header {
height: 100px;
background-color: #B3E5FC;
}
#nav {
height: 100px;
background-color: #81D4FA;
}
#main {
}
#aside {
width: 30%;
height: 780px;
background-color: #4FC3F7;
float: left;
}
#article1 {
width: 70%;
height: 260px;
background-color: #29B6F6;
float: left;
}
#article2 {
width: 70%;
height: 260px;
background-color: #03A9F4;
float: left;
}
#article3 {
width: 70%;
height: 260px;
background-color: #039BE5;
float: left;
}
#footer {
height: 100px;
background-color: #0288D1;
}
/* clearfix */
.clearfix::before,
.clearfix::after {
content: '';
display: block;
line-height: 0;
}
.clearfix::after {
clear: both;
}
/* 미디어쿼리 */
@media (max-width: 1300px){
#wrap {
width: 96%;
}
#article2 {
width: 35%;
height: 520px;
}
#article3 {
width: 35%;
height: 520px;
}
}
@media (max-width: 768px){
#wrap {
width: 100%;
}
#article1 {
width: 70%;
height: 390px;
}
#article2 {
width: 70%;
height: 390px;
}
#article3 {
display: none;
}
}
@media (max-width: 480px){
#aside {
width: 100%;
height: 100px;
}
#article1 {
width: 100%;
height: 430px;
}
#article2 {
width: 100%;
height: 150px;
}
}
</style>
</head>
<body>
<div id="wrap">
<div id="header"></div>
<div id="nav"></div>
<div id="main" class="clearfix">
<div id="aside"></div>
<div id="article1"></div>
<div id="article2"></div>
<div id="article3"></div>
</div>
<div id="footer"></div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="ko">
<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>레이아웃 유형03</title>
<style>
* {
margin: 0;
padding: 0;
}
body {
background-color: #E1F5FE;
}
#wrap {
width: 1200px;
margin: 0 auto;
}
#header {
height: 100px;
background-color: #B3E5FC;
}
#nav {
height: 100px;
background-color: #81D4FA;
}
#main {
display: flex;
flex-wrap: wrap;
flex-direction: column;
height: 780px;
}
#aside {
width: 30%;
height: 780px;
background-color: #4FC3F7;
}
#article1 {
width: 70%;
height: 260px;
background-color: #29B6F6;
}
#article2 {
width: 70%;
height: 260px;
background-color: #03A9F4;
}
#article3 {
width: 70%;
height: 260px;
background-color: #039BE5;
}
#footer {
height: 100px;
background-color: #0288D1;
}
/* 미디어쿼리 */
@media (max-width: 1300px){
}
@media (max-width: 768px){
}
@media (max-width: 480px){
}
</style>
</head>
<body>
<div id="wrap">
<div id="header"></div>
<div id="nav"></div>
<div id="main">
<div id="aside"></div>
<div id="article1"></div>
<div id="article2"></div>
<div id="article3"></div>
</div>
<div id="footer"></div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="ko">
<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>레이아웃 유형03</title>
<style>
* {
margin: 0;
padding: 0;
}
body {
background-color: #E1F5FE;
}
#wrap {
width: 1200px;
margin: 0 auto;
}
#header {
height: 100px;
background-color: #B3E5FC;
}
#nav {
height: 100px;
background-color: #81D4FA;
}
#main {
display: flex;
flex-wrap: wrap;
flex-direction: column;
height: 780px;
}
#aside {
width: 30%;
height: 780px;
background-color: #4FC3F7;
}
#article1 {
width: 70%;
height: 260px;
background-color: #29B6F6;
}
#article2-1 {
width: 100%;
height: 260px;
background-color: #03A9F4;
}
#article2-2 {
width: 100%;
height: 260px;
background-color: #039BE5;
}
#footer {
height: 100px;
background-color: #0288D1;
}
/* 미디어쿼리 */
@media (max-width: 1300px){
#wrap {
width: 96%;
}
#article2 {
display: flex;
}
#article2-1 {
width: 50%;
height: 520px;
}
#article2-2 {
width: 50%;
height: 520px;
}
}
@media (max-width: 768px){
#wrap {
width: 100%;
}
#article1 {
width: 100%;
height: 390px;
}
#article2-1 {
width: 100%;
height: 390px;
}
#article2-2 {
display: none;
}
}
@media (max-width: 480px){
#aside {
width: 100%;
height: 200px;
}
#article1 {
height: 430px;
}
#article2-1 {
height: 150px;
}
}
</style>
</head>
<body>
<div id="wrap">
<div id="header"></div>
<div id="nav"></div>
<div id="main">
<div id="aside"></div>
<div id="article1"></div>
<div id="article2">
<div id="article2-1"></div>
<div id="article2-2"></div>
</div>
</div>
<div id="footer"></div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="ko">
<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>레이아웃 유형03</title>
<style>
* {
margin: 0;
padding: 0;
}
body {
background-color: #E1F5FE;
}
#wrap {
width: 1200px;
margin: 0 auto;
}
#header {
height: 100px;
background-color: #B3E5FC;
}
#nav {
height: 100px;
background-color: #81D4FA;
}
#main {
display: grid;
grid-template-areas:
"aside article1 article1"
"aside article2 article2"
"aside article3 article3";
grid-template-columns: 300px 900px;
grid-template-rows: 260px 260px 260px;
}
#aside {
background-color: #4FC3F7;
grid-area: aside;
}
#article1 {
background-color: #29B6F6;
grid-area: article1;
}
#article2 {
background-color: #03A9F4;
grid-area: article2;
}
#article3 {
background-color: #039BE5;
grid-area: article3;
}
#footer {
height: 100px;
background-color: #0288D1;
}
/* 미디어쿼리 */
@media (max-width: 1300px){
}
@media (max-width: 768px){
}
@media (max-width: 480px){
}
</style>
</head>
<body>
<div id="wrap">
<div id="header"></div>
<div id="nav"></div>
<div id="main">
<div id="aside"></div>
<div id="article1"></div>
<div id="article2"></div>
<div id="article3"></div>
</div>
<div id="footer"></div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="ko">
<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>레이아웃 유형03</title>
<style>
* {
margin: 0;
padding: 0;
}
body {
background-color: #E1F5FE;
}
#wrap {
width: 1200px;
margin: 0 auto;
}
#header {
height: 100px;
background-color: #B3E5FC;
}
#nav {
height: 100px;
background-color: #81D4FA;
}
#main {
display: grid;
grid-template-areas:
"aside article1 article1"
"aside article2 article2"
"aside article3 article3";
grid-template-columns: 30% 70%;
grid-template-rows: 260px 260px 260px;
}
#aside {
background-color: #4FC3F7;
grid-area: aside;
}
#article1 {
background-color: #29B6F6;
grid-area: article1;
}
#article2 {
background-color: #03A9F4;
grid-area: article2;
}
#article3 {
background-color: #039BE5;
grid-area: article3;
}
#footer {
height: 100px;
background-color: #0288D1;
}
/* 미디어쿼리 */
@media (max-width: 1300px){
#wrap {
width: 96%;
}
#main {
grid-template-areas:
"aside article1 article1"
"aside article2 article3"
"aside article2 article3";
grid-template-columns: 30% 35% 35%;
grid-template-rows: 260px 520px;
}
}
@media (max-width: 768px){
#wrap {
width: 100%;
}
#main {
grid-template-areas:
"aside article1"
"aside article2";
grid-template-columns: 30% 70%;
grid-template-rows: 390px 390px;
}
#article3 {
display: none;
}
}
@media (max-width: 480px){
#main {
grid-template-areas:
"aside"
"article1"
"article2";
grid-template-columns: 100%;
grid-template-rows: 200px 430px 150px;
}
}
</style>
</head>
<body>
<div id="wrap">
<div id="header"></div>
<div id="nav"></div>
<div id="main">
<div id="aside"></div>
<div id="article1"></div>
<div id="article2"></div>
<div id="article3"></div>
</div>
<div id="footer"></div>
</div>
</body>
</html>