
Design comparison
Solution retrospective
I was happy that I was able to complete the project. My frontend skills are moldy and this was a good challenge to brush them off. I am happy I was able to replicate the design.
What challenges did you encounter, and how did you overcome them?I had a bit of trouble the image being centered and the bottom half of the card being spaced properly. I googled around for padding and margins.
What specific areas of your project would you like help with?If there is a better way to deal with the padding/ margins. It felt a bit fiddly.
Community feedback
- P@huyphan2210Posted 19 days ago
Hi @Taylor-McNeil,**
I've reviewed your solution, and I’d like to share my thoughts:
-
Centering the
<img>
using Flexbox
Since you used Flexbox to center<main>
, you can apply the same approach to center your<img>
. Just apply Flexbox properties to its parent (.qr-container-img
):/* Make the parent a flex container */ display: flex; /* Center the image inside */ justify-content: center; align-items: center;
-
Understanding
margin
andpadding
You mentioned having trouble with spacing and foundpadding
andmargin
to adjust the layout. However, it seems there’s some confusion about what they do. Here’s a clearer explanation:- An HTML element consists of content,
padding
,border
, andmargin
. padding
is the space inside the element, between the content and the border.margin
is the space outside the element, creating distance from other elements.
Visual Representation:
- An HTML element consists of content,
MARGIN (space outside) ┌───────────────────────────┐ │ │ │ BORDER (edge of element) │ │ ┌─────────────────────┐ │ │ │ PADDING (inside) │ │ │ │ ┌───────────────┐ │ │ │ │ │ CONTENT │ │ │ │ │ └───────────────┘ │ │ │ │ │ │ │ └─────────────────────┘ │ │ │ └───────────────────────────┘
Using this structure, you can better understand how spacing works and adjust it accordingly for the desired layout.
Let me know if you need further clarification!
Hope this helps!
Marked as helpful1 -
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