Design comparison
Solution retrospective
Hi lads, well this time i tried something different. I set it up the width and height with vw and vh, also i sue grid to set the elements in the change part. I checked the output in 1280px width, 800px height, tbh i don't like how it looks i'm still struggling with the output but i guess i need to keep practicing.
Community feedback
- @tenze21Posted 10 months ago
woah... it looks like your order summary component has a lot of work to do. Everything is falling out of place.
0 - @TkDevkPosted 10 months ago
I just checked it and the image looks apart :'c, damn.
I guess that it doesn't matter the default width and height values
0@BlackpachamamePosted 10 months ago@TkDevk This is because you put a
height
withvh
, so it will change depending on each screen, on some it will look good and on others it won't. I tried setting aheight: 580px
to your#card
and it looks fine.Also, remove the
object-fit: contain
from your#card-picture img
. And theheight: 25svh
of your#card-picture
. This is enough for the image to fit the width of the card.Marked as helpful1@TkDevkPosted 10 months ago@Blackpachamame Hi marcos, thank you for your feedback. You are right, i don't the height value for the image.
But i have a question regarding the css units, what do you think that is the better choice when it comes to design something like a card could be better vh or px? i was doing this thing moving numbers with VH but it doesn't look as good as PX, i would like to say that is better px but maybe if you can advise me about the units i will be grateful.
0@BlackpachamamePosted 10 months ago@TkDevk Es buena pregunta, voy a responderte con lo que vi y leí en algún lado y por experiencia propia.
- El
vh
se usa para cuando necesitas "jugar" con el viewport de la pantalla, por ejemplo, que en la pantalla se vea una imagen en específico y al scrollear hacia abajo veamos otra imagen distinta y así sucesivamente. Normalmente lo usamos para centrar el contenido delbody
- Los
px
(Unidades absolutas) por lo general se usan para medidas muy pequeñas, por ejemplo, losborder
o losborder-raidus
- Los
%
se usan para las fuentes - Por otro lado, los
em
yrem
(Unidades relativas) suelen usarse para el resto porque se adaptan mucho mejor a los cambios en la pantalla que lospx
Pero esto es a mi parecer, para profundizar en el tema tendrás que investigar y probar por tu cuenta. Igual te dejo este artículo por ahí te sirve.
Marked as helpful2 - El
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