I haven\'t added content to my page yet, since I\'m still working on the header and footer. I noticed that my footer, instead of being at the bottom of the page, like it would b
Minimal Example:
body {
display: flex;
flex-flow: column;
min-height: 100vh; /* have the flex container at least take up the viewport */
margin: 0;
font-size: 20px;
}
footer {
margin-top: auto;
background: #999999;
}
Header
Some random content
Using the same minimal example above but with long content:
body {
display: flex;
flex-flow: column;
min-height: 100vh; /* have the flex container at least take up the viewport */
margin: 0;
font-size: 20px;
}
div {
height: 3000px;
}
footer {
margin-top: auto;
background: #999999;
}
Header
Some random content
Using the OP's code:
body {
font-family: Lato;
margin: 0px;
padding: 0px;
width: 100%;
display: flex;
flex-flow: column;
min-height: 100vh;
}
header {
height: 80px;
padding-left: 20px;
padding-right: 5px;
padding-top: 15px;
}
header h1 {
display: inline;
}
header nav {
float: right;
font-size: 18pt;
}
header nav a {
color: #999;
line-height: 50px;
margin-right: 20px;
text-decoration: none;
}
header nav a:hover {
color: #666;
}
header nav a.currentPage {
color: #7a7acc;
}
header nav a.currentPage:hover {
color: #7a7acc;
}
footer {
margin-top: auto;
background-color: #f2f2f2;
color: #666;
font-size: 12pt;
padding: 20px;
text-align: center;
}
footer div {
max-width: 750px;
margin: 0px auto;
}
footer a {
color: #666;
}