I have divs called bottom, left, right and top. I want to put inside them a div called "center". I want to make it look like this:
======top======
| left- center -right |
------bottom-----------
Sound simple, but when I try to do this i have problems with my divs escaping from specified position.
body {
!important margin: 0 auto;
}
#container {
margin: 0 auto;
width: 50%;
}
#headertop {
background-color: #0000CD;
margin-top: 50px;
padding-bottom: 80px;
}
#left {
background-color: #6495ED;
padding-bottom: 400px;
width: 10%;
float: left;
}
#right {
background-color: #0000CD;
padding-bottom: 400px;
margin-left: 600px;
width: 10%;
float: right;
}
#bottom {
clear: both;
background-color: #6495ED;
padding-bottom: 80px;
}
<div id="container">
<header>
<div id="headertop">
</div>
</header>
<main>
<div id="center">
</div>
</main>
<aside>
<div id="left">
</div>
<div id="right">
</div>
</aside>
<footer>
<div id="bottom">
</div>
</footer>
</div>