.site-wrapper
header Header
main
h1 Flexbox Sticky Footer Example
p When the main content area takes up less space than the viewport height, the footer will stick to the bottom. After the content exceeds the viewport height, the footer will be pushed accordingly.
input(type="checkbox" id="show-content")
label(for="show-content") Show more content
div.main-content
p It suddenly struck me that that tiny pea, pretty and blue, was the Earth. I put up my thumb and shut one eye, and my thumb blotted out the planet Earth. I didn't feel like a giant. I felt very, very small.
p Never in all their history have men been able truly to conceive of the world as one: a single sphere, a globe, having the qualities of a globe, a round earth in which all the directions eventually meet, in which there is no center because every point, or none, is center — an equal earth which all men occupy as equals. The airman's earth, if free men make it, will be truly round: a globe in practice, not in theory.
p If you could see the earth illuminated when you were in a place as dark as night, it would look to you more splendid than the moon.
p As we got further and further away, it [the Earth] diminished in size. Finally it shrank to the size of a marble, the most beautiful you can imagine. That beautiful, warm, living object looked so fragile, so delicate, that if you touched it with a finger it would crumble and fall apart. Seeing this has to change a man.
p Never in all their history have men been able truly to conceive of the world as one: a single sphere, a globe, having the qualities of a globe, a round earth in which all the directions eventually meet, in which there is no center because every point, or none, is center — an equal earth which all men occupy as equals. The airman's earth, if free men make it, will be truly round: a globe in practice, not in theory.
p As I stand out here in the wonders of the unknown at Hadley, I sort of realize there’s a fundamental truth to our nature, Man must explore . . . and this is exploration at its greatest.
p I believe every human has a finite number of heartbeats. I don't intend to waste any of mine
p For those who have seen the Earth from space, and for the hundreds and perhaps thousands more who will, the experience most certainly changes your perspective. The things that we share in our world are far more valuable than those which divide us.
p Here men from the planet Earth first set foot upon the Moon. July 1969 AD. We came in peace for all mankind.
p Curious that we spend more time congratulating people who have succeeded than encouraging people who have not.
footer Footer
View Compiled
// Foundation styles for sticky footer
.site-wrapper {
display: flex;
flex-direction: column;
min-height: 100vh;
}
main {
flex: 1;
}
// Other styles
@import url('https://fonts.googleapis.com/css?family=Sumana:400,700');
body {
font-family: 'Sumana', sans-serif;
}
* {
box-sizing: border-box;
}
header,
footer,
main {
padding: 18px;
}
main {
margin: 24px auto;
}
h1, p {
margin-bottom: 24px;
}
p {
line-height: 1.4;
}
label {
font-weight: 700;
}
header {
color: white;
background-color: mediumaquamarine;
}
footer {
color: white;
background-color: lightseagreen;
}
.main-content {
display: none;
}
input:checked ~ .main-content {
display: block;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.