CSS CSS Basics The Box Model Margins

ems

In the video i get that the font-size ems are calculated on default 16.. but margins arent worked out the same i just cant see it?

1 Answer

Steven Parker
Steven Parker
201,915 Points

The "em" unit is based on the font size of the parent element, it has no default.

The unit that is based on the default document font is the "rem" (root em).

And margins are an entirely different setting than font sizes. They are not related unless you explicitly set them using "em" or "rem" units.