Created
February 9, 2021 04:46
-
-
Save vijayjangid/268a990dc38443df0d208a0cf375c0ee to your computer and use it in GitHub Desktop.
Simple flexbox 2x2 matrix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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