A Pen by Wilson Staley on CodePen.
Created
April 14, 2023 16:24
-
-
Save flinthamm/5aa22a69f1a5049ec37980d1c0f64cda to your computer and use it in GitHub Desktop.
Responsive Grid
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
| <div class='container'> | |
| <div class="item">1</div> | |
| <div class="item">2</div> | |
| <div class="item">3</div> | |
| <div class="item">4</div> | |
| <div class="item">5</div> | |
| <div class="item">6</div> | |
| </div> |
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, | |
| body { | |
| background: GhostWhite; | |
| margin: 0; | |
| } | |
| .container { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); | |
| grid-auto-rows: 100px; | |
| grid-gap: 2rem; | |
| padding: 2rem; | |
| } | |
| .item { | |
| background: MidnightBlue; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| font-size: 2rem; | |
| color: MediumSpringGreen; | |
| font-family: sans-serif; | |
| box-shadow: 6px 10px 15px -3px rgba(0, 0, 0, 0.1); | |
| border-radius: 8px; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment