Created
November 16, 2023 08:27
-
-
Save iam-amanxz/2bac5c049901ac4251736404a2af2057 to your computer and use it in GitHub Desktop.
CSS Card Layout with Subgrid Snippet
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
.main-grid { | |
display: grid; | |
grid-auto-flow: dense; | |
gap: 1rem; | |
grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); | |
grid-auto-rows: 120px auto auto auto; | |
container-type: inline-size; | |
} | |
.card { | |
display: grid; | |
grid-gap: 1rem; | |
border: 1px solid grey; | |
padding: 1rem; | |
border-radius: 10px; | |
grid-row: span 4; | |
grid-template-rows: subgrid; | |
overflow: hidden; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment