Https://www.codecademy.com/paths/web-development/tracks/getting-more-advanced-with-design/modules/css-code-challenges/lessons/learn-css-code-challenges/exercises/padding-margin-challenge

https://www.codecademy.com/paths/web-development/tracks/getting-more-advanced-with-design/modules/css-code-challenges/lessons/learn-css-code-challenges/exercises/padding-margin-challenge

I thought I understood padding vs margin but this exercise has left me extremely confused. I have no idea how to answer it, even after looking at the solution

2 Likes

Margin is outer space of an element, while padding is inner space of an element. Margin is the space outside the border of an element, while padding is the space inside the border of it. Margin accepts the value of auto: margin : auto , but you can’t set padding to auto.

I hope this helps =)

1 Like