25 CSS Hacks Every Developer Should Know

Problem: making a footer stick to the bottom of the page.

Solution: use Flexbox.

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1;
}
footer {
  background-color: #f1f1f1;
  padding: 10px;
  text-align: center;
}