Complete 2020 Web Development Bootcamp

Section 5 – Lesson 50 – CSS Sizing

Font Size

The font size CSS property controls the size of the text in the element selected. You can use pixels, percentages, and em’s.

1em equals 16px. 16px equals 100%.

When using percentages or em’s to set font sizes it is important to remember that they are inherited from parent elements by child elements so that can greatly increase a child’s font size.

In CSS3 there is something called rem. This refers to root em – rem ignores any parent font size settings. This ensures that the child element is the size that is specified in the CSS used for that element and doesn’t inherit any sizing from a parent element.