Last active
November 27, 2018 08:50
-
-
Save khleomix/a61ac83417fb5c6786ae9be816749e1c to your computer and use it in GitHub Desktop.
CSS Grid using Fractional Units
This file contains 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
.container { | |
display: grid; | |
grid-template-columns: repeat(4, 1fr); /* this will create a 4 columns grid equal width */ | |
/* grid-template-columns: 1fr 1fr 2fr; can also be used like this */ | |
grid-template-rows: repeat(3, 100px); /* will create 3 rows with 100px height each */ | |
grid-gap: 1em; /* will add gutters in between rows and columns at 1em each */ | |
/* grid-gap: 1em 2em; 1em row gaps and 2em column gaps */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment