When length of an element is specified using em
,
it is calculated based on the font size
of the element.
If an element has no font-size
specified,
the length is calculated based on the
font size of its nearest parent element.
In the above example, the width and height
of the h1
were calculated based on the
font-size
of its parent element (div
),
as font-size
was not specified
for the child element (h1
).