Design comparison
Community feedback
- @correlucasPosted about 2 years ago
πΎHi Giovanni, congratulations for your first solution!π Welcome to the Frontend Mentor Coding Community!
Great solution and great start! By what I saw youβre on the right track. Iβve few suggestions to you that you can consider to add to your code:
Your component is perfect, but is not responsive yet, this is due the
fixed width
you've applied to the container.Look both
width
andmax-width
the main difference between these properties is that the first(width) is fixed and the second(max-width) isflexible
, for example, a component withwidth: 320px
will not grow or shrink because the size will be ever the same, but a container withmax-width: 320px
ormin-width: 320px
can grow or contract depending of the property you've set for the container. So if you want a responsive block element, never usewidth
choose ormin-width
ormax-width
.Note that there's no need to use
height
here, because since you set aheight
for an element, this means that this element will grow until a certain point and after that the inner content (as texts or images) will start to pop out the element due its fixed height, so isn't necessary to set theheight
the container height comes from the elements, its paddings and height.βοΈ I hope this helps you and happy coding!
Marked as helpful0 - @denieldenPosted about 2 years ago
Hi Giovanni, congratulations on completing the challenge, great job! π
Some little tips for optimizing your code:
- remove
height and padding
properties frommain
tag - you can use
article
tag instead of a simplediv
to the container card for improve the Accessibility - remove all unnecessary code, the less you write the better as well as being clearer: for example the
figure
container of image - remove all
margin
fromcard
class - use flexbox to the body to center the card. Read here -> best flex guide
- after, add
min-height: 100vh and margin: 0
to body because Flexbox aligns child items to the size of the parent container - instead of using
px
use relative units of measurement likerem
-> read here
Hope this help! Happy coding π
Marked as helpful0@MagnificoRettorePosted about 2 years ago@denielden Thank you for your support!! Now I adjust all the code π
1@denieldenPosted about 2 years ago@MagnificoRettore You are welcome and keep it up :)
0 - remove
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