
December 8th, 2012, 06:52 PM
|
 |
Contributing User
|
|
Join Date: Aug 2011
Location: The Pleiades
|
|
Ok, played with the code and got it working.
You have your footer div BEFORE the 'p1','p2' divs. I put your footer div below that in the HTML and also changed some CSS.
I will highlight everything I've changed.
Code:
<div id="top">
<div id="nav"></div>
</div>
<!--your footer was here for some reason??-->
<div id="main">
<div class="p1">
<a href="bla" class="lp1"></a>
</div>
<div class="p2">
<a href="bla" class="lp2"></a>
</div>
<div class="p3">
<a href="bla" class="lp3"></a>
</div>
<div class="p4">
<a href="bla" class="lp4"></a>
</div>
</div>
<div class="footer"></div>
CSS:
Code:
body{
margin: 0;
background-color: grey;
position: relative;
}
#top{
width: 800px;
height: 75px;
background-color: black;
margin: auto;
position: relative;
}
#nav {
width: 300px;
height: 45px;
background-color: blue;
position: absolute;
right: 15px;
top: 15px;
}
#main {
background-color: grey;
height: 500px;
width: 600px;
margin: auto;
position: relative;
top: 12%;
}
.p1 {
background-color: brown;
height: 245px;
width: 295px;
position: absolute;
top: 0px;
left: 0px;
}
.p2 {
background-color: brown;
height: 245px;
width: 295px;
position: absolute;
top: 0px;
right: 0px;
}
.p3 {
background-color: brown;
height: 245px;
width: 295px;
position: absolute;
bottom: 0px;
left: 0px;
}
.p4 {
background-color: brown;
height: 245px;
width: 295px;
position: absolute;
bottom: 0px;
right: 0px;
}
a.lp1 {
display: block;
width: 100%;
height: 245px;
}
a.lp2 {
display: block;
width: 100%;
height: 245px;
}
a.lp3 {
display: block;
width: 100%;
height: 245px;
}
a.lp4 {
display: block;
width: 100%;
height: 245px;
}
.footer {
background-color: black;
height: 40px;
width: 800px;
margin: auto;//this is to center
position: relative;//changed to relative
bottom: 0px;
}
Hope this helps you.
Kind regards,
Nm.
__________________
"WERE NOT WORTHY!"
"WERE NOT WORTHY!"
Last edited by Nanomech : December 9th, 2012 at 05:25 AM.
|