TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The CSS Sticky Footer

57 pointsby RevRalabout 15 years ago

9 comments

terryjsmithabout 15 years ago
Same technique, tested in IE6 to IE8, FF, Chrome, Safari and Opera; no conditionals:<p><pre><code> html, body, #canvas { height: 100%; } body &#62; #canvas { height: auto; min-height: 100%; } #canvas { width: 100%; position: absolute; } #footer { position: absolute; bottom: 0; } </code></pre> HTML:<p><pre><code> &#60;body&#62; &#60;div id="canvas"&#62; &#60;!-- all of your other code --&#62; &#60;div id="footer"&#62;&#60;/div&#62; &#60;/div&#62; &#60;/body&#62;</code></pre>
评论 #1255102 未加载
voidpointerabout 15 years ago
This is a good example of what is still utterly wrong today with HTML/CSS implementations. I appreciate the work and the fact that it is shared with the public. The fact that you still have to deal with this sort of markup in 2010 is really sad.
mtarnovanabout 15 years ago
Or just use Compass with Blueprint <a href="http://wiki.github.com/chriseppstein/compass/" rel="nofollow">http://wiki.github.com/chriseppstein/compass/</a> and it's one line of code from there:<p>+sticky-footer(200px)
jackowayedabout 15 years ago
That's cool. I think the most surprising part, upon reading the CSS, is that the only special fixes are for Opera and IE8. So IE7 and IE6 just work.
评论 #1255010 未加载
评论 #1254587 未加载
braksandwichabout 15 years ago
I love this technique, though its been around for a while.<p>This is where I first saw it: <a href="http://www.themaninblue.com/writing/perspective/2005/08/29/" rel="nofollow">http://www.themaninblue.com/writing/perspective/2005/08/29/</a>
ck2about 15 years ago
Do y'all really care for this on websites you use?<p>It drives me crazy when I am scrolling a large page if there is nothing useful down there, and I immediately adblock it.
评论 #1254680 未加载
wrinklzabout 15 years ago
It's cool, but why not just stick a minimum height in your content div?
评论 #1254850 未加载
csmederabout 15 years ago
Thank you!
briansmithabout 15 years ago
It isn't working on IE8.
评论 #1254634 未加载