Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sticky footers without any wrappers #12579

Merged
merged 1 commit into from
Feb 8, 2014
Merged

Sticky footers without any wrappers #12579

merged 1 commit into from
Feb 8, 2014

Conversation

lipis
Copy link
Contributor

@lipis lipis commented Feb 4, 2014

This approach is much cleaner, smaller and simpler to understand and it works with IE8+, Chrome, Safari, Firefox, Opera!

Here are the example in action without any #wrap divs:
sticky-footer-navbar
sticky-footer


That's the new CSS for sticky footers without the #wrap looks like this:

html {
  position: relative;
  min-height: 100%;
}
body {
  /* Margin bottom by footer height */
  margin-bottom: 60px;
}
#footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  /* Set the fixed height of the footer here */
  height: 60px;
  background-color: #f5f5f5;
}

This solution was found here: http://mystrd.at/modern-clean-css-sticky-footer/ and of course all the credit goes there!

@mdo
Copy link
Member

mdo commented Feb 4, 2014

And Mobile Safari and Chrome for Android?

@lipis
Copy link
Contributor Author

lipis commented Feb 4, 2014

Chrome/Safari on iPad (iOS7) and Chrome on Android (N5) are also good.. no extra scroll bars and work as expected for bigger contents..

@boulox
Copy link
Contributor

boulox commented Feb 4, 2014

Just check it out on Android chrome with galaxy S4 looks great

@lipis
Copy link
Contributor Author

lipis commented Feb 8, 2014

This one is also fixing the issue #12600

@mdo mdo merged commit 40e1a3b into twbs:master Feb 8, 2014
@mdo mdo mentioned this pull request Feb 8, 2014
1 task
@lipis lipis deleted the better-sticky-footer branch February 9, 2014 00:01
@vanhumbeecka
Copy link

Too bad that my original files are broken with the new version of bootstrap.
(the wrap-and-push method for sticky footer).

No backwards compatiblity?
Than I'll have to downgrade my bootstrap version in my project..

@mdo
Copy link
Member

mdo commented Mar 3, 2014

Generally speaking we don't stick to things too closely for the example files as they are outside the core CSS and JS. That said, there's really not much different between this version and the previous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants