Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Footer won't stay on bottom of page
Old 12-21-2008, 10:16 PM Footer won't stay on bottom of page
Skilled Talker

Posts: 71
Trades: 0
I'm stuck and can't find a solution, so hopefully ya'll can help me out.

I can't get my footer to stay on the bottom of the page. Usually I don't have this problem, I dunno why I am now. I tried the absolute positioning with bottom:0; however that doesn't work. It works initially, but once the page stretches it doesn't go with it, just stays there.

style.css
Code:
/* kill defaults */
html, body, ul, dl, li, h1, h2, h3, h4, img    {
margin: 0;
padding: 0;
}

ul    {
list-style: none;
}

img    {
border: 0;
}
/* ============= */

html {
    height:100%;
    }

body {
    background-color:#1c261b;    
    height:100%;
    }

.bg {
    background-image:url(images/bg.gif);
    background-repeat:repeat-y;
    margin:auto auto;
    width:1120px;
    min-height:100%;
    }

.container {
    margin:auto auto;
    width:979px;
    min-height:100%;
    margin-left:71px;
    }

.banner {
    background:url(images/banner.gif) no-repeat;
    width:979px;
    height:180px;
    margin:auto auto;
    }

.footer {
    background:url(images/footer.gif) no-repeat;
    width:979px;
    height:68px;
    position:absolute;
    bottom:0px;
    }

.nav {
    background:url(images/navbg.gif) repeat-x;
    width:100%;
    height:29px;
    }

.clear { clear:left; }

.leftColumn {
    width:298px;
    float:left;
    border:1px solid #000;
    border-left:none;
    }

.middleColumn {
    width:379px;
    float:left;
    border:1px solid #000;
    }

.rightColumn {
    width:298px;
    float:right;
    border:1px solid #000;
    border-right:none;
    }

.leftColumnSmall {
    width:228px;
    float:left;
    border:1px solid #000;    
    border-left:none;
    }

.middleColumnSmall {
    width:449px;
    float:left;
    border:1px solid #000;
    }

.headerFeaturedMatch {
    background:url(images/header_featuredmatch.gif) no-repeat;
    width:298px;
    height:23px;
    }

.headerRecentNews {
    background:url(images/header_recentnews.gif) no-repeat;
    width:379px;
    height:23px;
    }

.headerFidelityTeams {
    background:url(images/header_fidelityteams.gif) no-repeat;
    width:298px;
    height:23px;
    }

.headerMatchResults {
    background:url(images/header_matchresults.gif) no-repeat;
    width:228px;
    height:23px;
    }

.headerRecentNewsLarge {
    background:url(images/header_recentnews_large.gif) no-repeat;
    width:449px;
    height:23px;
    }

.result {
    background:url(images/_result.gif) no-repeat;
    width:298px;
    height:153px;
    border:1px solid #000;    
    border-left:none;
    border-right:none;
    }

.news {
    background:url(images/_news.gif) no-repeat;
    width:379px;
    height:153px;
    border:1px solid #000;
    border-left:none;
    border-right:none;
    }

.teams {
    background:url(images/_teams.gif) no-repeat;
    width:298px;
    height:358px;
    border:1px solid #000;
    border-left:none;
    border-right:none;
    }

.results {
    background:url(images/_results.gif) no-repeat;
    width:228px;
    height:174px;
    border:1px solid #000;
    border-left:none;
    border-right:none;
    }

.post {
    background:url(images/_post.gif) no-repeat;
    width:449px;
    height:287px;
    border-left:none;
    border-right:none;
    }
index.php
Code:
<!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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <title></title>
  <link rel="stylesheet" type="text/css" href="<?php echo rootpath; ?>style.css" />
</head>
<body>
<div class="bg">
  <div class="container">
    <div class="banner"></div>
    <div class="nav"></div>
    <div class="leftColumn">
      <div class="headerFeaturedMatch"></div>
      <div class="result"></div>
    </div>
    <div class="middleColumn">
      <div class="headerRecentNews"></div>
      <div class="news"></div>
    </div>
    <div class="rightColumn">
      <div class="headerFidelityTeams"></div>
      <div class="teams"></div>
    </div>
    <div class="clear"></div>
    <div class="leftColumnSmall">
      <div class="headerMatchResults"></div>
      <div class="results"></div>
    </div>
    <?php

    include ($page.'.php');

    ?>
    <div style="clear:both;"></div>
    <div class="footer"></div>    
  </div>  
</div>
</body>
</html>
Please excuse the very messy CSS, I was just testing stuff that would normally be dynamic in my template and will later clean it up.

This is what happens when the page stretches:

<huge image removed so we can read the posts>
Let me know if you see anything out of place. I need this done ASAP.

Last edited by chrishirst; 12-22-2008 at 03:49 PM..
CrazeDizzleD is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-22-2008, 06:19 AM Re: Footer won't stay on bottom of page
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.candsdesign.co.uk/article...sticky-footer/
http://ryanfait.com/sticky-footer/
http://www.themaninblue.com/writing/...ve/2005/08/29/
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-22-2008, 07:20 AM Re: Footer won't stay on bottom of page
Skilled Talker

Posts: 71
Trades: 0
I don't want to do it with Javascript just to ensure compatibility.

I've tried the other two methods you posted and neither work for me.

Can you give me an example using the code I posted?
CrazeDizzleD is offline
Reply With Quote
View Public Profile
 
Old 12-22-2008, 08:19 AM Re: Footer won't stay on bottom of page
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Then just let the footer take it's natural position.

Which, in my code it will do if javascript is disabled.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-22-2008, 09:38 AM Re: Footer won't stay on bottom of page
Skilled Talker

Posts: 71
Trades: 0
Its natural position is half way up the page, which looks horrible.
CrazeDizzleD is offline
Reply With Quote
View Public Profile
 
Old 12-22-2008, 09:44 AM Re: Footer won't stay on bottom of page
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Plant both feet firmly on footer, and wait awhile...I've tried this, and it's proven to work better than super glue (aka coding)
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 12-22-2008, 09:56 AM Re: Footer won't stay on bottom of page
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Looks to me like your floats are not properly cleared, causing that big gap between the red area at the top and the bottom of the page.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-22-2008, 10:28 AM Re: Footer won't stay on bottom of page
Skilled Talker

Posts: 71
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Looks to me like your floats are not properly cleared, causing that big gap between the red area at the top and the bottom of the page.
If you notice on the right, I'm scrolled down a little. On that screenshot, while scrolled all the way up, the footer rests on the bottom of the page like it should. However when the content stretches like it is there, it doesn't go with it, just stays in the same place.
CrazeDizzleD is offline
Reply With Quote
View Public Profile
 
Old 12-22-2008, 10:43 AM Re: Footer won't stay on bottom of page
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Try getting rid of the clearing divs and try putting overflow: auto on #container (to clear the floats). You also must remove the position:absolute on the footer, add margin: 0 auto (to center it) AND you must make sure that #footer follows the closing </div> for #container.

One other thing - IE6 doesn't support min/max width or height, so you're going to have to add a height: 100% in a separate stylesheet called by conditional comments for IE6.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by LadynRed; 12-22-2008 at 10:45 AM..
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-22-2008, 10:22 PM Re: Footer won't stay on bottom of page
Skilled Talker

Posts: 71
Trades: 0
Thank you LadynRed, it works perfectly on Firefox now.

But on IE6, unless the content is stretched, the container stops about halfway up the page. I guess because like you said, IE doesn't understand min-height. So I tried this:

Code:
.container {
    margin:auto auto;
    width:979px;
    min-height:1000px;
    margin-left:71px;
    overflow:auto;
    }

* html .container { height:1000px; }
And now I have scrollbars on my IE.

EDIT: I tried overflow:none on IE and that works like it should, but then it doesn't on FF. I tried doing the * html .container {overflow:none;} but that doesn't work.

Any ideas? I'd like to use only one stylesheet if I can help it.

Last edited by CrazeDizzleD; 12-22-2008 at 10:25 PM..
CrazeDizzleD is offline
Reply With Quote
View Public Profile
 
Old 12-22-2008, 11:30 PM Re: Footer won't stay on bottom of page
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 9,007
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
Overflow:


Possible values

visible
Content is not clipped by the rectangle of the parent element.

hidden
Content is clipped by the rectangle of the parent element.

scroll
Content is clipped by the rectangle of the parent element but scroll bars are provided to enable viewing of content outside the clipped region.

auto
Depends on Web browser.

inherit
Use the same computed value as the parent element for this property.

Default value

visible


Source: http://xhtml.com/en/css/reference/ , which is an awesome quick reference.


Note that none is not a possible value.



IE doesn't understand diddly unless you force it. For the moment you'll have to be content with conditional comments for IE once you get it right for FF.


tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by serandfae; 12-22-2008 at 11:31 PM..
serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 12-23-2008, 12:29 AM Re: Footer won't stay on bottom of page
Experienced Talker

Latest Blog Post:
Jobs in Zaragoza
Posts: 33
Name: Mehul
Location: Hyderabad,inda
Trades: 0
thanks people had similar problem bfore i just changed the theme
CyberWorldJobs is offline
Reply With Quote
View Public Profile Visit CyberWorldJobs's homepage!
 
Old 12-27-2008, 12:05 PM Re: Footer won't stay on bottom of page
Super Talker

Posts: 143
Trades: 0
Have you thought about using frames. This will force the footer to stay all the way at the bottom of the page, maybe not the best method but it will not move around on you.
__________________

Please login or register to view this content. Registration is FREE
specialk is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Footer won't stay on bottom of page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.89421 seconds with 12 queries