Design comparison
Community feedback
- @BlackpachamamePosted 10 months ago
Greetings! you have done a great job š
š Some suggestions
- Use
min-height
andmax-width
, this will help the content stretch or shrink if you need to. Unlikeheight
andwidth
which can cause your content to be cut off on certain screens - Do not use
%
forwidth
orheight
. Better userem
,em
orpx
- You can apply
display: block
to the image to remove the white space generated underneath. Although visually in this case it is irrelevant, it helps you better calculate the space with other elements - Instead of using
margin
to center your content in the center of the screen, you can use theflexbox
properties in thebody
:
body { min-height: 100vh; display: flex; justify-content: center; align-items: center; flex-direction: column; gap: 20px; /* Separate the main from the footer */ }
Marked as helpful1@EnverUstaPosted 10 months agoHey @Blackpachamame
Thank you so much for this valuable feedback. I will be revising my codes again. I also have a question, why don't you prefer using
%
? As an example shouldn't I use%
in the image?1@BlackpachamamePosted 10 months ago@EnverUsta Because you would have to adjust the percentage for each screen using media queries. They can lead to unexpected results, for example, this same challenge that you did, on my screen you see a container about 130px wide and high that occupies the entire screen.
1@EnverUstaPosted 10 months ago@Blackpachamame I see that's true. I should use px, rem, or em if I won't use media-queries. However, using
%
in img make sense from my perspective. What do you think about it?0@BlackpachamamePosted 10 months ago@EnverUsta You probably use media querys with other units, but I'm sure they adapt much better than
%
. Here you can find a little more detailed information of the types of units and what they are recommended to use for.0@EnverUstaPosted 10 months ago@Blackpachamame When I revise your code for this project, it seems like you used
%
for the img as well. (Don't forget what I am trying to say is in theimg
)1@BlackpachamamePosted 10 months ago@EnverUsta Oh! then it was my confusion. Indeed, for the image to fit correctly to the width of the container, you should use
max-width: 100%
as you did.I was referring to the
%
for thewidth
andheight
of the containers, like the one in yourqr-code-container
classAn apology for the confusion
1@EnverUstaPosted 10 months ago@Blackpachamame No worries, and your review helped me a lot! It's awesome to see such helpful people!
1@EnverUstaPosted 10 months ago@Blackpachamame Also as a side note, we don't need to add
display: block
if we usedisplay: flex
in the parent of img. It simply solves underneath white-space issue š1 - Use
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