Log in

View Full Version : cant keep a good footer down...



SirTom909
02-19-2009, 12:04 PM
Hello every, grateful if some one could me with this,

im trying to keep my footer down, its set to abolsute. However when i test it in 1024x768 it begins to over lap my <body>

is there another way to keep it down?

code attached

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="generator" content="HTML Tidy for Linux (vers 6 November 2007), see www.w3.org" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<title>Test</title>
<link rel="stylesheet" type="text/css" href="styles_home.css" />
</head>
<body>
<div id="container">

<div id="header"></div>
<!--Navigation-->
<div id="body">
<div class="links mainmenu">
<ul>
<li><a href="">Home</a></li>
<li><a href="">About</a></li>
<li><a href="">Contact Us</a></li>
<li><a href="">Search</a></li>
</ul>
</div>
<div id="welcome">
<div id="welcometext"></div>
</div>
<div id="leftholdertop">
<div id="leftholdertoptext"></div>
</div>
<div id="rightholdertop">
<div id="rightholdertoptext"></div>
</div>
<div id="leftholderbottom">
<div id="leftholderbottomtext"></div>
</div>
<div id="rightholderbottom">
<div id="rightholderbottomtext"></div>
</div>

</div>

<div id="footer"></div>
</div>

</body>
</html>




@charset "utf-8";
/* CSS Document */

html, body {height:100%}
body {

height: 100%;
background:#339900;
color:#000000;
text-align:center;
margin:0;
font-size: 100%;


}

#container {

width:750px;
min-height:100%;
position:relative;
text-align:left;
margin: 0 auto 95 auto;

}


#header {

width:750px; height:150px; background:url('images/header.jpg') no-repeat top; float:left; position:relative;

}

#body {

padding-bottom:95px;


}

.links {

float:left;
width:750px;
text-align:left;
background:url('/images/homepagedivider.jpg') repeat ;

}



.mainmenu {

width:750px;
float:left;
padding:0px;
display:inline;

}

.mainmenu ul {


float:left;
margin:0 0 0 0;
padding:0 0 0 0;
text-transform:uppercase;
display:inline;

}

.mainmenu ul li {


float:left;
margin:0px;
padding:0px;
display:inline;
list-style:none;

}

.mainmenu ul a
{

float:left;
display:block;
padding:2px 8px 2px 4px;
font-weight:bold;
font-size:85%;
text-decoration:none;
color:#ffffff;
font-family:Arial, Helvetica, sans-serif;
background:url('/images/homepagedivider.jpg') no-repeat 0px 0px;


}



#welcome {

width: 750px;
height: 260px;
float: right;
background:url('images/welcomebg.jpg') no-repeat;

}

#welcometext {

padding: 1px 360px 0px 115px;
font-weight:bold;
font-size:85%;
text-decoration:none;
color:#ffffff;
font-family:Arial, Helvetica, sans-serif;

}


#leftholdertop {

width: 350px;
height: 150px;
float: left;
background:url('images/left_holder_top.jpg') no-repeat;
margin: 0 0 0 0;

}

#leftholdertoptext {

padding: 0px 0px 0px 0px;

}


#rightholdertop {

width: 400px;
height: 150px;
float: right;
background:url('images/right_holder_top.jpg') no-repeat;
margin: 0 0 0 0;


}


#rightholdertoptext {

padding: 0px 0px 0px 0px;

}




#leftholderbottom {

width: 350px;
height: 150px;
float: left;
background:url('images/left_holder_bottom.jpg') no-repeat;
margin: 0 0 0 0;


}

#leftholderbottomtext {

padding: 0px 0px 0px 0px;

}

#rightholderbottom {

width: 400px;
height: 150px;
float: right;
background:url('images/right_holder_bottom.jpg') no-repeat;
margin: 0 0 0 0;


}


#rightholderbottomtext {

padding: 0px 0px 0px 0px;

}



#footer {
position: absolute;
bottom:0;
margin: 0 0 0 0;
width: 750px;
height:95px;
background:url('images/footer.jpg') bottom center no-repeat;

}

Snookerman
02-19-2009, 12:18 PM
Have you tried the sticky footer (http://ryanfait.com/sticky-footer/)?

SirTom909
02-19-2009, 01:57 PM
yeah i tried it, however when viewing the page in 1024x768 the footer still sits ontop of the content :S

Snookerman
02-19-2009, 02:09 PM
Try this:

#container {
width: 750px;
min-height: 100%;
position: relative;
text-align: left;
margin: 0 auto 95px;
}

Good luck!

SirTom909
02-19-2009, 02:21 PM
thank you SnookerMan, sadly the footer still creeps up the page....

this is driving me mad.... :confused:

SirTom909
02-19-2009, 02:55 PM
update:

I went through Ryans tutorial, and the footer sits at the top of the page behind the header.

what attribute should I give the footer on top of what ive already set?


width: 750px;
background:url('images/footer.jpg') bottom center no-repeat;

note that if i set it to absolute it will sit on top of the content and if i set


bottom:0;

it wont display the footer in IE :S

Snookerman
02-19-2009, 03:11 PM
Do you have a page where you test this? It would be easier if you posted a link so we can take a look.

SirTom909
02-19-2009, 03:21 PM
unfortunately its running on an intranet..

ill keep trying...

Medyman
02-19-2009, 08:21 PM
http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page