Design comparison
Community feedback
- @hectorestebanmPosted about 2 years ago
Buenas Elena, felicidades por completar este desafío. Te faltaría sólo centrar la card en el medio de la pantalla. Me han recomendado una forma de hacerlo y quiero compartirla contigo.
Dentro del body agrega las siguientes líneas
display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh;
De esa forma centrarás la card tanto horizontal cómo verticalmente.
Otro tics que te puedo dar es que quites el margin que tienes dentro de la clase "div.qr-code", para que el footer no te quede tan separado de la card. El diseño está bien hecho, una vez más felicidades por completar el desafío, a seguir programando.
Marked as helpful1@ElenaKondrashovaPosted about 2 years ago@hectorestebanm Thanks a lot for your comment! I've updated my code with your suggestion and it works so much better. Appreciate your feedback. Thanks again :)
0 - @tltd0807Posted about 2 years ago
Hi Elena, congrats on completing your project here! It looks very nice, In my opinion, you should use display: flex for the ".description" instead of position: absolute for the h1 and p tag. It is just my opinion, by the way, I have learned from your solution a lot. Have a nice day 😁😁
Marked as helpful1@ElenaKondrashovaPosted about 2 years ago@tltd0807 Thank you very much for your comment and insights! Indeed it works much better with display:flex :)
0 - @correlucasPosted about 2 years ago
👾Hello Elena, congratulations for your new solution!
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.Think about using relative units as
rem
orem
instead ofpx
to improve your performance by resizing fonts between different screens and devices.Anyhow, if we want a more accessible website, then we should use rem instead of px. REM does not just apply to font size, but to all sizes as well.✌️ I hope this helps you and happy coding!
Marked as helpful0@ElenaKondrashovaPosted about 2 years ago@correlucas Once again, thanks so much Lucas for your detailed explanation. I think I starting to get the responsiveness. I've tried to implement it in the solution for a new challenge :) I think I will re-do QR code entirely.
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