Skip to content

Instantly share code, notes, and snippets.

@khleomix
Last active November 27, 2018 08:50
Show Gist options
  • Save khleomix/a61ac83417fb5c6786ae9be816749e1c to your computer and use it in GitHub Desktop.
Save khleomix/a61ac83417fb5c6786ae9be816749e1c to your computer and use it in GitHub Desktop.
CSS Grid using Fractional Units
.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