Design comparison
SolutionDesign
Solution retrospective
Any feedback on how to prevent repetition of same css code would be appreciated.
Community feedback
- @danielmrz-devPosted 12 months ago
Hello @Kashyxp-patel!
Your project looks great!
If your trying to reduce code lines, I have a suggestion that may interest you:
- Since you set
display:flex;
to thediv.container
, you can use the propertygap
to separate the items instead of usingmargins
.
You can use
gap
on a flex container to create an equally sized space between elements inside of it.- Like this:
.container { display: flex; flex-direction: column; justify-content: center; align-items: center; >> gap: 10px; << padding: 1.25rem; }
- Also, you can replace your
div.card
with amain.card
tag. It won't change anything visually, but it makes your HTML more semantic.
I hope it helps!
Other than that, great job!
0 - Since you set
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