Last active
December 7, 2023 15:31
-
-
Save ozrabal/1fdd9389a6b2859caef86dfaf8a55ded to your computer and use it in GitHub Desktop.
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
:root { | |
--flex-gap: 1rem; /* Variable for gap */ | |
} | |
.flexbox { | |
display: flex; | |
flex-wrap: wrap; | |
gap: var(--flex-gap); | |
justify-content: center; | |
padding: var(--flex-gap); /* We use padding to give space between the edge of the flexbox and flex items */ | |
} | |
.flex-items { | |
--flex-items: 1; /* Number of flex items*/ | |
align-items: flex-end; | |
aspect-ratio: 3 / 4; | |
display: flex; | |
justify-content: center; | |
width: calc((100% / var(--flex-items)) - (((var(--flex-items) - 1) / var(--flex-items)) * var(--flex-gap))); | |
} | |
.flex-title { | |
background-color: rgba(0, 0, 0, .5); | |
color: #ffffff; | |
padding: .5rem; | |
text-align: center; | |
width: 100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment