143k views
3 votes
If you have an element with the font size of 32px, and a child element inside with a a font-size set to 2em, what is the font size of the child in px? (Provide a number only, not the measurement too.)

1 Answer

3 votes

Final answer:

The font size of the child element is 64 pixels, which is calculated by multiplying the parent's font size of 32px by the child's font-size property of 2em.

Step-by-step explanation:

When calculating the font size of a child element based on its parent's font size using em units in CSS, we take the parent's font size and multiply it by the value set for the child's font-size property. In this example, the parent element has a font size of 32px and the child element has a font size of 2em.

To find the font size of the child element in pixels, we multiply 32 by 2 (the em value), which gives us:

64px.

Therefore, the child element's font size is 64 pixels.

User Sochas
by
7.4k points