Automatic horizontal margins

https://www.codecademy.com/paths/web-development/tracks/getting-more-advanced-with-design/modules/learn-css-box-model/projects/box-model-on


why we have to set the automatic horizontal margin for content.body when we have already set the margin for the whole content class?

You are setting the margin for a child element inside of it’s parent element (container). Consider this simplified example:
Margin%20Example

Hope this helps!

1 Like