Learn Responsive desing - Em

.splash-section {
  font-size: 18px;
}
 
.splash-section h1 {
  font-size: 1.5em;
}

in this example, font size of h1 will be 18 * 1.5 = 27 and h1 is in .splash-section class, so my question is what if h1 is not member of splash-section class, will h1 font-size still 27 or change to 24 (16 * 1.5) ? like below

.splash-section {
    font-size: 18px;
}
h1                     //not member of .splash-section
{
    font-size:  1.5em;      
}

em will equal to the current font size of the element, and if it doesn’t have a font size it will inherit the font size from its parent, or if the parent also doesn’t have a font size, it will continue the search for the next parent until it found one with font size or reach the body element or even the root element.

=========================

Also please, there is a tool in Codecademy forums to refactor your code so it can be more readable, you can find it next to the upload tool or just use ctrl + shift + c as a shortcut. you can edit your post and use it.

2 Likes