Welcome to the Treehouse Community
Looking to learn something new?
Context of padding !
I am not sure , but is that correct that when we want to calculate a fluid -padding- the context will be its width ! not the parent width -if has parent - !!
Because margin use the parent width for sure as a context .
Guil HernandezTreehouse Teacher
You are correct, Omar.
The context for
% is the width of the content area.
The context for ems is the font-size of the element.
One way to think of this might be to consider the CSS box model.
Padding adds space inside the box, so it's context is within the box also.
Margin adds space around (or outside) the box, so the context is the next box up (parent).
@guil Thank you so much for answering :)
@keithwyland Great idea to keep in mind , thank you ^_^