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 trial

HTML How to Make a Website Styling Web Pages and Navigation Review: Styling Web Pages and Navigation

What is parent element?

What is parent element?

3 Answers

Jonny Noble
Jonny Noble
11,165 Points

For example - body is a parent to header, main, footer etc.

Thank you! I'm a bit confused with the question, "Why should images be set to a max-width of 100%?" The answer is that it will fill their parent element. What does this mean?

altair
altair
6,548 Points

It means that the image will fill the entire space of the element one level above it.

For example:

<body> 
  <div>
    <img>
  </div>
</body>

Here the div element is the parent of the img tag, and the body element is the parent of the div tag.

Thank you! I got it now.