Design comparison
SolutionDesign
Solution retrospective
Why do the child elements of the grid container take up the width of the content if I set them to 1fr? Just started to practice grid)
Community feedback
- @rfilenkoPosted over 4 years ago
Hey, cool hover effects, but doesn't suits here)) 1fr means available space, so behavior is correct and each card takes abour 1/3 of container minus gaps. You can also write shorter syntax - grid-template-columns: repeat(3, 1fr).
Cheers, Roman
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord