(2019/04) 반응형 사이트 만들기 - 반응형 레이아웃 유형2
반응형 웹 사이트를 만들기 위한 가장 기본적이 반응형 레이아웃 연습 예제입니다. 영상을 보면서 같이 따라하세요^^
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
* {margin: 0; padding: 0;}
#wrap {width: 100%; height: 900px; margin: 0 auto;}
header {width: 100%; height: 150px; background: #81c784;}
aside {float: left; width: 30%; height: 700px; background: #66bb6a;}
section {float: left; width: 40%; height: 700px; background: #4caf50;}
article {float: left; width: 30%; height: 700px; background: #43a047;}
footer {clear: both; width: 100%; height: 150px; background: #388e3c;}
/* 화면 너비 0 ~ 1200px */
@media (max-width: 1200px){
aside {width: 40%;}
section {width: 60%;}
article {width: 100%; height: 300px;}
}
/* 화면 너비 0 ~ 768px */
@media (max-width: 768px){
aside {width: 100%; height: 300px;}
section {width: 100%; height: 300px;}
}
/* 화면 너비 0 ~ 480px */
@media (max-width: 480px){
header {height: 300px;}
aside {height: 200px;}
section {height: 200px;}
article {height: 200px;}
}
</style>
</head>
<body>
<div id="wrap">
<header></header>
<aside></aside>
<section></section>
<article></article>
<footer></footer>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="wrap">
<header></header>
<aside></aside>
<section></section>
<article></article>
<footer></footer>
</div>
</body>
</html>
* {margin: 0; padding: 0;}
#wrap {width: 100%; height: 900px; margin: 0 auto;}
header {width: 100%; height: 150px; background: #81c784;}
aside {float: left; width: 30%; height: 700px; background: #66bb6a;}
section {float: left; width: 40%; height: 700px; background: #4caf50;}
article {float: left; width: 30%; height: 700px; background: #43a047;}
footer {clear: both; width: 100%; height: 150px; background: #388e3c;}
/* 화면 너비 0 ~ 1200px */
@media (max-width: 1200px){
aside {width: 40%;}
section {width: 60%;}
article {width: 100%; height: 300px;}
}
/* 화면 너비 0 ~ 768px */
@media (max-width: 768px){
aside {width: 100%; height: 300px;}
section {width: 100%; height: 300px;}
}
/* 화면 너비 0 ~ 480px */
@media (max-width: 480px){
header {height: 300px;}
aside {height: 200px;}
section {height: 200px;}
article {height: 200px;}
}
4강 진행합니다. 감사합니다.
완강하세요^^
http://over1991.dothome.co.kr/reponsive/layout4-1.html
감사합니다 :D
수고하셨어요^^
열심히 따라가고 있습니다 선생님 감사합니다 ㅠㅠ
하 근데 완성소스 안보고 먼저해보는데 계속틀려요 ㅠㅠ 정답보고서야 알았네요 ㅠㅠ
이번에도 너비 카테고리3개로 조정하지만 결과값은 4개가 나오게 하는데 실패했어요 ^^.. (3개만나옴ㅜㅜ)