Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Kris Tryber
10,416 PointsCSS footer problem
Hey everyone I am having a really tough time getting my footer to show up at the bottom of the page no matter what.
I am building the website utilizing twitter bootstrap so I imagine that I have some conflict somewhere between my style.css and bootstraps.
[www.poweronlytransit.com] This is the website.
[http://pastebin.com/mZLJG1Lz] Here is the code from top to bottom. I am utilizing php to link the header and footer normally but I posted it all on one page in hopes it would be easier to read.
[http://pastebin.com/aCMbeYw6] Here is my CSS, sorry it's kind of a mess.
Thank you in advance for any help/tips. Kris
7 Answers
Nikolaos Papathanassopoulos
10,322 PointsDo you want your footer to be fixed at the bottom? Because when i open your site the footer appears...
~ Nikos
Kris Tryber
10,416 PointsSorry Nikolaos, I wasnt clear.
So on the home page it seems to appear correctly, but if you go to the "get a quote" page it shows up at the bottom on my 13" macbook but then on my big monitor shows up about 1/4 up the page, basically below the content.
Hope this helps.
Kris
Nikolaos Papathanassopoulos
10,322 PointsAllright. This is simple.
The position of the #nav-footer div is defined by the content of the rest of the container.
If you have much content (homepage) the footer appears to be at the end of the site. If not its shown where the content ends.
If you want to get rid of it try using
#your-footer-id{
position: relative;
bottom: 0px;
}
in your css.
~ Nikos.
Kris Tryber
10,416 PointsNikos,
Thanks a lot! your suggestion didn't fix it 100% but it got me in the right direction. What I did was wrapped my whole footer in a different div named "footer" then pasted this.
.footer {
position: absolute;
bottom: 0px;
background-color: #27241d;
width: 100%;
height: 100px;
}
and now it's at the bottom of both my monitors. Just need to play around with some margins and I think it's good to go.
Thanks again, Kris
seth123
Courses Plus Student 226 PointsWin XP SP2 using Google Chrome (most recent version) and IE7 both show the page footer properly. Which CMS framework are you on? Homebrew? Joomla? Wordpress?
The issue is that without a thoroughly coded back-end to support cross OS/Browser displays you will run into issues with CSS overlap for display elements as well as "jenky" display attributes for a number of elements.
Example: I have a client that refuses to use web approved colors for their logos and typography for the website I am building for them resulting is very strange looking colors on certain browsers and OS's. Specifically the logo color does not match the rest of the website in certain IE browsers.
I'll take a closer look at your CSS and see if I can be more case-specific to your inquiry.
Kris Tryber
10,416 PointsSeth,
currently I am not using a CMS. its just HTML/CSS and php. However I am using twitter bootstrap with it as well.
Also I am on mac OSX mountain lion using chrome.
Rick Yentzer
5,885 PointsKris, I think you're wanting the footer to stick to the bottom of the window no matter the height of the content, correct?
If so, try Ryan Fait's Stick Footers