Design comparison
Solution retrospective
This is my first frontendmentor project as an excited frontend learner!
I would greatly appreciate any form of feedback or issues on the site. This project was also my first time using git with a project, which proved to be much easier than I expected once I jumped into it.
One problem I did struggle with through this project was when to use padding or margin in css. When background colors are different, it is an easy choice as padding will add more color. However, in this project where all background colors are the same, I did not know when to use which property. When should padding be used and when should margin be used?
Community feedback
- @ericsalviPosted over 3 years ago
Knowing the main difference between margins and padding should help with your question. Margin is used to space content outside the container you are targeting. Padding is the space on the inside from the edge of the container.
Margins would be used to separate blocks from one another. Example spacing of different card elements. Use padding to space the elements inside the card and away from the card border. Hope that helps.
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