Skip to content

Instantly share code, notes, and snippets.



Last active Nov 6, 2019
What would you like to do?
Perfect Base Layout with Flexbox
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Flexbox Layout</title>
body {
margin: 0;
.layout {
background-color: black;
display: flex;
flex-direction: column;
justify-content: space-between;
height: 100vh;
.layout-main {
background-color: white;
padding: 20px;
margin: 100px;
.layout-section {
color: white;
padding: 20px;
<div class="layout">
<header class="layout-section">Header</header>
<main class="layout-main">Main Content</main>
<footer class="layout-section">Footer</footer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment