<!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>
<style>
*{font-size: 20px; color: black; text-align: center; line-height: 50px;
font-weight: bold;}
.header1, .footer1{background-color:lightskyblue;
height: 50px; width: 100%;}
.header1{margin-bottom: 10px;}
.footer1{margin-top: 10px;}
.main::after{clear: both; content: ''; display: block;}
.main{height: 500px; text-align: center; }
nav, aside{background-color:lightskyblue; width: calc(20% - 5px);
height: 100%;float: left; line-height: 500px;}
aside{float: right;}
section{background-color: rgb(200, 132, 240); width: calc(60% - 10px);
height: 100%; float: left; margin-left: 10px;}
section>.header2{background-color: lightskyblue; margin: 0 10px;
height: 50px;}
section>article{background-color: lightskyblue; margin: 10px;
height: calc(100% - 170px - 30px); line-height: 300px;}
section>.footer2{background-color: lightskyblue; margin: 10px;
height:70px; line-height: 70px;}
</style>
</head>
<body>
<header class="header1"><header></header>
<div class="main">
<nav><nav></nav>
<section><section>
<header class="header2"><header></header>
<article><article></article>
<footer class="footer2"><footer></footer>
</section>
<aside><aside></aside>
</div>
<footer class="footer1"><footer></footer>
</body>
</html>
<!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>
<style>
*{font-weight: bold; color: white; font-size: 20px; text-align: center;}
.header, footer{height: 50px; text-align: center; line-height: 50px; background-color: indianred;
font-size: 20px;}
.container::after{content: ''; clear: both; display: block;}
.container{margin: 10px 0;}
nav,aside{width: 100px; height: 400px; float: left; line-height: 400px;
background-color: indianred;}
aside{float: right;}
section{height: 400px; background-color: indianred; float: left;
width: calc(100% - 200px - 20px); margin-left: 10px; padding: 10px; box-sizing: border-box;
}
.title{ height: 30px; line-height: 30px;}
.container > section > header{ height: 50px; background-color: darkkhaki; line-height: 50px;}
.container > section > footer{ height: 80px; background-color: darkkhaki; line-height: 80px;}
.container > section > article{ height: calc(100% - 160px - 20px); background-color: darkkhaki;
line-height: 180px; margin: 10px 0;}
</style>
</head>
<body>
<header class="header"><header></header>
<div class="container">
<nav><nav></nav>
<section>
<div class="title"><section></div>
<header><header></header>
<article><article></article>
<footer><footer></footer>
</section>
<aside><aside></aside>
</div>
<footer><footer></footer>
</body>
</html>
'괴발개발 > Html+CSS' 카테고리의 다른 글
CSS_transition (0) | 2021.06.12 |
---|---|
CSS_z-index (0) | 2021.06.12 |
CSS_가로로 사각형 등분하기 (0) | 2021.06.11 |
CSS_크기가 불규칙한 박스 4등분하기 (0) | 2021.06.11 |
CSS_박스 나란히 삼등분하기 (0) | 2021.06.10 |