Created
January 20, 2014 22:30
-
-
Save korof/8530582 to your computer and use it in GitHub Desktop.
CSS: Stopka zawsze na samym dole strony
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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;
}`