Skip to content

Instantly share code, notes, and snippets.

@ftonato
Created December 12, 2016 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ftonato/a2694cc770decf29656cbbf4bd2a648b to your computer and use it in GitHub Desktop.
Save ftonato/a2694cc770decf29656cbbf4bd2a648b to your computer and use it in GitHub Desktop.
Basic Flexbox
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Basic Flexbox</title>
<style>
* {
margin: 0;
padding: 0;
}
main {
display: flex;
flex-wrap: wrap;
height: 100%;
}
.box {
padding-top: 2rem;
padding-bottom: 2rem;
}
.first {
width: 100%;
order: 1;
background-color: #f1c40f;
}
.second {
width: 33.33%;
order: 2;
background-color: #e67e22;
}
.third {
width: 33.33%;
order: 3;
background-color: #e74c3c;
}
.fourth {
width: 33.33%;
order: 4;
background-color: #9b59b6;
}
.fifth {
width: 50%;
order: 5;
background-color: #1abc9c;
}
.sixth {
width: 50%;
order: 5;
background-color: #34495e;
}
</style>
</head>
<body>
<main>
<div class="box first">&nbsp;</div>
<div class="box second">&nbsp;</div>
<div class="box third">&nbsp;</div>
<div class="box fourth">&nbsp;</div>
<div class="box fifth">&nbsp;</div>
<div class="box sixth">&nbsp;</div>
</main>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment