Responsive single price gird component using flexbox and grid
Design comparison
Solution retrospective
Would like feedback on best practices when it comes to achieving the spacing of the text, found some difficulty with it but managed to get it down. Just wondering if what I did was best practice.
Community feedback
- @adonmez04Posted about 1 year ago
Hi, @ForbiddenShadow. That's a good solution. Keep coding. Here are some important tips.
1 - Don't use
percentage units
for yourpadding
andmargin
values. This style creates many problems for future maintainers, and it's not legible. Userem
unit orclamp
function instead ofpercentage
.I think the
clamp
function will be the default unit for padding and margin in the near future, to make the websites more responsive. You can check this function here: https://developer.mozilla.org/en-US/docs/Web/CSS/clampAnd you can create fluid units from here: https://utopia.fyi/
2 - For more readable code, you can give your container four-sided
padding
values as consistently as possible:padding: 2rem 1.5rem;
And you can give its children some space with
margin-bottom
like:.item1 { margim-bottom: 1rem; } .item2 { margim-bottom: 1rem; } .item3 { margim-bottom: 2rem; }
3 - You can use unordered list
ul
andli
tags for your.why-container
part. These texts look like lists, so you can easily useul
and inside itli
elements.I hope these will help you. Keep coding and have a wonderful day.
Marked as helpful1@AmeerMoustafaPosted about 1 year ago@adonmez04 I will try to keep these in mind and practice them. Your response was very helpful, thanks a ton.
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