Skip to content

Instantly share code, notes, and snippets.

@korof
Created January 20, 2014 22:30
Show Gist options
  • Save korof/8530582 to your computer and use it in GitHub Desktop.
Save korof/8530582 to your computer and use it in GitHub Desktop.
CSS: Stopka zawsze na samym dole strony
* {
margin: 0;
}
html, body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -155px; /* the bottom margin is the negative value of the footer's height */
}
.footer, push {
height: 155px; /* .push must be the same height as .footer */
}
<div class="wrapper">
<div id="header">
header - (menu, logo)
</div>
<div id="content">
page content
</div>
<div class="push"></div>
</div>
<div class="footer">
footer
</div>
@korof
Copy link
Author

korof commented May 26, 2016

flexbox version:

`html{
height: 100%;
}

body{
display: flex;
flex-direction: column;
height: 100%;
}

.main{
/* The main section will take up all the available free space
on the page that is not taken up by the footer. */
flex: 1 0 auto;
}

footer{
/* The footer will take up as much vertical space as it needs and not a pixel more. */
flex: 0 0 auto;
}`

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