Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialEnemuo Felix
1,895 PointsUsing em
Which parent element will the P element below be relative to in this case ?
<div>
<h1>This is the first element</h1>
<h2>This is the second element</h2>
<p> This is the third element</p>
</div>
body {
font-size: 2em;
}
h1 {
font-size: 1.625em;
}
h2 {
font-size: 1.25em;
}
p {
font-size: 1em;
}
Ashley Georges Souffrant
2,828 PointsThe parent element in this case would be the <div> element or tag therefore relative. The <h1> and <h2> tags are child elements just as <p>. This includes 1 parent element <div> and 3 children elements <h1>, <h2> and <p>. Hope this helps !
Enemuo Felix
1,895 PointsAshley Georges Souffrant Very Helpful! However, you might want to consider changing your comment to an answer. Thumbs up to Kristian and Steven too. You guys are amazing!
1 Answer
steven swensen
7,926 Pointsyou can use rem which ties it to the root.
Kristian Woods
23,414 PointsKristian Woods
23,414 PointsThe p element is a child of the div and a sibling of the h2 and h1