The easiest way to achieve this is to set min-height to the content above footer like this:
HTML:
This is content of the page
CSS:
section {
min-height: 100vh; /* minus the height of the footer */
}
jsfiddle link: https://jsfiddle.net/x55xh3v7/
But more "optimized" solution is the sticky footer techique which prevents the footer from unnecessary flowing out of the page.