Skip to content

Instantly share code, notes, and snippets.

@joshmedeski

joshmedeski/index.html

Last active Nov 6, 2019
Embed
What would you like to do?
Perfect Base Layout with Flexbox
<!DOCTYPE html>
<html lang="en">
<head>
<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>
<style>
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;
}
</style>
</head>
<body>
<div class="layout">
<header class="layout-section">Header</header>
<main class="layout-main">Main Content</main>
<footer class="layout-section">Footer</footer>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment