I have divs named bottom, left, right, and top. I am looking to place a div called "center" inside each of them in order to achieve the following layout:
======top======
| left- center -right |
------bottom-----------
Although it seems straightforward, I encounter issues with my divs escaping their designated positions.
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>