Design comparison
Solution retrospective
I'm proud of being able to do this without much difficulty. Next time I would like to use css grid
What challenges did you encounter, and how did you overcome them?The challenge I had the most was spacing the link buttons. I tried to keep the spacing as close to the original as possible.
What specific areas of your project would you like help with?I would like some help in terms of knowing which padding or margin is better, this is what made me struggle the most.
Community feedback
- @RagudosPosted 7 months ago
Hello, Sebastian. Great job! First, I recommend adding transitions for the "color" property as well to avoid the flickering effect, which is disturbing for the eyes.
As for your question, a padding is an extension of an element, almost like a width/height, but it acts like a margin. By this, I mean that a padding's location will contain the element's background color, border, etc.
You can think of it like the border-box model in CSS:
inner: content around inner: padding around padding: border around border: margin
The good thing about margin is that you can centralize objects using that:
// Let the browser decide how much margin the element will take horizontally. This means that its margin will be as large as the space it has horizontally. margin-inline: auto;
So, with padding, since it wraps around the content, if we have a fixed width/height, adding it would squeeze our contents tighter to each other. While with margin, it would just move our element. Take note that sometimes a margin will not move our element because of resistance, for example, with flexbox, although it only occurs on certain cases.
Kudos!
Marked as helpful0
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