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.

CSS Forum


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



Reply
Positioning a footer at the bottom of a page
Old 09-08-2011, 06:38 PM Positioning a footer at the bottom of a page
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
I have the following page:

and am trying to position the footer so that it is always at the bottom of the page with:
Code:
#footer {
overflow: hidden;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 10px 0;
background: #db921a; }
However it only seems to be aligning with the bottom of the page, not the browser as such (see attached image).

Does anyone know what I might be missing?
Attached Images
File Type: png Screen Shot 2011-09-08 at 23.35.25.png (47.7 KB, 12 views)
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 09-08-2011, 07:14 PM Re: Positioning a footer at the bottom of a page
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
Is HTML's height set to 100%? Try this code:

Code:
html{background:#00ff00;}body{background:#0000ff;}
You should not see any white. There should be a red page with blue down to where you footer approximately is.
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 09-09-2011, 05:17 AM Re: Positioning a footer at the bottom of a page
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Thanks, that works okay in that situation. But when more content is added to the page the footer does not seem to go to the bottom of the page.

See in the attached image how the text seems to overlap the footer?
Attached Images
File Type: png Screen Shot 2011-09-09 at 10.15.45.png (126.3 KB, 8 views)
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 09-09-2011, 01:19 PM Re: Positioning a footer at the bottom of a page
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
You need to set min-height to html and body.

Code:
min-height: 100%;
Also, another tip. Place a div at the bottom of your wrapper, lets call it "push", to push your content up a bit so that it doesn't slip underneath the footer. Make it the same height as your footer, i.e.:

Like this:
HTML Code:
<div id="wrapper">
   Your code as before...

   <div id="push"></div>
</div>
<div id="footer">
   Your footer...
</div>
Code:
#footer { height: 50px; }
#push { height: 50px; clear: both; }
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 09-13-2011, 07:59 AM Re: Positioning a footer at the bottom of a page
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Hmmm I've set

Code:
html, body {
    height: 100%;
}
However the body only extends to the fold, not the page as such.

See the attached image, I've made the body green and the html red. This is when testing at 1280 x 768, it appears fine at lager resolutions.

Does anyone have any ideas?
Attached Images
File Type: png Screen Shot 2011-09-13 at 12.57.25.png (93.7 KB, 3 views)
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 09-13-2011, 08:54 AM Re: Positioning a footer at the bottom of a page
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Does anyone have any ideas?
Nope, can't debug a picture.
__________________
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 09-13-2011, 09:17 AM Re: Positioning a footer at the bottom of a page
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Oops, forgot to upload the latest code sorry.

I managed to get around it with this in the end though, quite handy

http://www.cssstickyfooter.com/
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 09-13-2011, 09:39 AM Re: Positioning a footer at the bottom of a page
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Hmmm or maybe I didn't solve it, now I need to scroll to the bottom of the page in order to see the footer:
http://www.mattpealing.co.uk/concept/chm/

In the documentation on http://www.cssstickyfooter.com it states:
Quote:
must declare 0 margins on everything, also for main layout components use padding, not
vertical margins (top and bottom) to add spacing, else those margins get added to total height and your footer gets pushed down a bit more, creating vertical scroll bars in the browser
…which I imagined to be my problem, however even after adding:

Code:
* {
    margin:0 !important;
}
to the top of my stylesheet it still did not resolve the issue, even though I'd eliminated all margins.

I'm a bit puzzled as I have also stuck to the other guides here:
Code:
#main {overflow:auto;
    padding-bottom: 150px;}  /* must be same height as the footer */

#footer {position: relative;
    margin-top: -150px; /* negative value of footer height */
    height: 150px;
    clear:both;}
Any help would be great!
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 09-13-2011, 03:45 PM Re: Positioning a footer at the bottom of a page
jamestl2's Avatar
No scale-itch here...

Latest Blog Post:
Wordpress Relative URLs Plugin
Posts: 2,389
Name: <member type="brilliant" alt="foolish">James Lewitzke</member>
Location: / public_html / Universe / Virgo_Supercluster / Local_Group / Milky_Way / Orion_Arm / Solar_System / Earth / North_America / USA / Wisconsin
Trades: 0
If you're trying to absolutely position the footer at the bottom, then going by the code that's on this page...


The footer should be inside the min-height wrapper (in that page's case, the #wrapper div)

And the footer should have the following:

Code:
#footer {
position: absolute;
bottom: 0;
}
Then just clean the code up a bit by removing the #wrapper's top padding and the body's top border
__________________
Engipress -
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
for Wordpress Projects
jamestl2 is offline
Reply With Quote
View Public Profile Visit jamestl2's homepage!
 
Old 09-14-2011, 04:59 AM Re: Positioning a footer at the bottom of a page
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The only 100% reliable way is to use a bit of javascript.

http://www.candsdesign.co.uk/article...sticky-footer/

Written for this thread


demo page
__________________
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 09-19-2011, 04:43 AM Re: Positioning a footer at the bottom of a page
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Wow I had no idea there was so much work involved simply creating a sticky footer!

My client has decided it is no longer necessary so I haven't worked on getting it to stick to the bottom any more.

Thanks for the tips anyway, looks like I'll be giving JavaScript a shot next time.
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 09-24-2011, 12:00 PM Re: Positioning a footer at the bottom of a page
Average Talker

Posts: 17
Trades: 0
A really fixed footer isn't difficult. For a tutorial, surf to website-laten-maken-amsterdam-nh.nl. (Just make it into a link, because I cannot post any links here yet.)
__________________
Frank

Please report back how suggestions worked out.
FrankknarF is offline
Reply With Quote
View Public Profile
 
Old 09-24-2011, 12:06 PM Re: Positioning a footer at the bottom of a page
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Here's some thought on the topic
http://webmaster-talk.eu/?topic=445.0
__________________
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 09-24-2011, 01:42 PM Re: Positioning a footer at the bottom of a page
Average Talker

Posts: 17
Trades: 0
Thanks Chris, the direct link to the tutorial in question is mentioned in that forum thread. (The nickname FrankC was taken here.)
__________________
Frank

Please report back how suggestions worked out.
FrankknarF is offline
Reply With Quote
View Public Profile
 
Old 09-24-2011, 02:50 PM Re: Positioning a footer at the bottom of a page
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Ok so I'm preaching to the converted then
__________________
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 09-25-2011, 04:48 AM Re: Positioning a footer at the bottom of a page
Average Talker

Posts: 17
Trades: 0
Yep. Amen
__________________
Frank

Please report back how suggestions worked out.
FrankknarF is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Positioning a footer at the bottom of a 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 0.88708 seconds with 13 queries