Skip to content

Instantly share code, notes, and snippets.

@vijayjangid
Created February 9, 2021 04:46
Show Gist options
  • Save vijayjangid/268a990dc38443df0d208a0cf375c0ee to your computer and use it in GitHub Desktop.
Save vijayjangid/268a990dc38443df0d208a0cf375c0ee to your computer and use it in GitHub Desktop.
Simple flexbox 2x2 matrix
/* HTML */
<div class="container">
<div class="tile">1</div>
<div class="tile">2</div>
<div class="tile">3</div>
<div class="tile">4</div>
</div>
/* CSS */
.container {
display: flex;
width: 200px; // change based on the need
height: 200px; // change based on the need
flex-wrap: wrap;
}
.container .box {
flex-basis: 50%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment