Design comparison
Solution retrospective
I think I am most proud of the fact that I was able to make the simple design from scratch (in terms of styling) provided the asset..
What challenges did you encounter, and how did you overcome them?Mostly with setting the box on the middle. I always find setting a particular element on a position challenging. After a lot of trial and errors, and making use of my existing knowledge on CSS, I was able to come up with the final outcome.
What specific areas of your project would you like help with?I was able to copy the design but I really think it can be improved on especially with setting the position of the box in the middle as I'm not sure if my solution to that is even correct..
Community feedback
- @DylandeBruijnPosted 4 months ago
@ajasmine94
Hiya! π
Congratulations on your solution, it looks very close to the design! I can tell you put a lot of effort into it.
Things you could improve βοΈ
-
I suggest adding a bit of
padding
to yourbody
element so the card has some space around it on smaller viewports. -
Try experimenting with the CSS layout tool Flexbox, it will help you greatly structuring elements on your webpage. You can try centering your card for example.
-
To learn more about centering elements I recommend reading this guide.
-
You could add a
min-height: 100vh
to yourbody
element so it takes up the full height of the viewport while still being able to grow when the content inside it grows. -
Try experimenting with CSS variables, they help you make your CSS values more reusable across your code.
-
I suggest using clear descriptive CSS classes like
.card
,.card-title
and.card-description
. -
Try using semantic HTML elements like
main
,section
andarticle
. -
Try using using relative CSS units like
rem
andem
they make your layout more adaptable. -
Be careful with setting a fixed
width
andheight
on your elements. If the content in these elements grows beyond these restrictions youβll run into overflow issues. Keeping theheight
atauto
- whichblock
elements are by default - will be fine in most cases. -
You donβt need to put
width: 100%
onblock
elements, they already take up the full width of their parents by default. -
Try styling your elements using classes instead of IDβs. Most of the time they are the better choice. IDβs are mostly used to select elements using JavaScript, navigation on the page itself and to style unique elements.
-
I suggest leaving the
width
of yourbody
asauto
which it is by default. So to achieve this you can remove the fixedwidth
.
I hope you find my feedback helpful! π
Let me know if you have more questions and I'll do my best to answer them. πββοΈ
Happy coding! π
Marked as helpful1@ajasmine94Posted about 1 month ago@DylandeBruijn Hi Dylan, after learning about flexbox I have updated my solutions. It took a while but I wanted to thank you so much for the time and effort of providing this detailed feedback!! it helped greatly :)
0 -
- @danielmrz-devPosted 4 months ago
Hey there! ππ½ββοΈ
Congrats on completing the challenge! β
Your project looks fantastic!
Here's a tip to make it even better:
Using
margin
and/orpadding
isn't always the best way to center an element. Try this method to center an element vertically and horizontally:π Apply this CSS to the body (skip position or margins to make it work correctly):
body { min-height: 100vh; display: flex; justify-content: center; align-items: center; }
Hope this helps!
Keep up the great work!
Marked as helpful0
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