IT/Css

css3 - 레이아웃 배치 header, nav, section, footer, float

노마드오브 2018. 8. 28. 12:00

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Insert title here</title>

<style>

* {

border: 1px solid red;

}


html, body {

padding: 0;

margin: 0;

height: 100%;

}


div#page {

width: 1000px;

height: 800px;

margin-left: auto;

margin-right: auto;

margin-top: 70px;

}

header {

height : 15%;

background-color: yellow;

}

nav {

width : 20%;

height : 75%;

background-color: orange;

float : left;

margin : 0 10px;

}

section {

width: 740px;

height : 75%;

background-color: lightblue;

float: right;

margin : 0 10px;

}

footer {

height : 10%;

background-color: violet;

clear : both; 

}

</style>

</head>

<body>


<div id="page">

<header>header</header>

<nav>nav</nav>

<section>section</section>

<footer>footer</footer>

</div>


</body>

</html>