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 Make a CSS Image Gallery

I need help DESPERATELY!!!!

Hi,

Here is my objective 'Add CSS that will allow all images to fill their parent elements'

I am very confused.... Why? Because I don't know what a parent element is and really need an explanation!!! PLEASE HELP!

Thank You.

3 Answers

Cody Te Awa
Cody Te Awa
8,820 Points

A Parent element of the 'x' element is the element in which x is nested inside of. For example if we have a list. <ul> <li> <!-- is the parent of a--> <a>blah</a> </li> </ul>

Thank you! Cody.... you are a legend! Im only 12 and have completed HTML and CSS on Khan Academy and Code academy! Thanks to you guys I can make my own website on Treehouse.... Respect guys ;)

Thank you! Arturo you are a legend! Im only 12 and have completed HTML and CSS on Khan Academy and Code academy! Thanks to you guys I can make my own website on Treehouse.... Respect guys ;)

Hi Ibraheem

You should read up how the DOM tree works.

A very basic parent/child relationship:

<html>
   <head>
   </head>
   <body>
   </body>
</html>

In this example html is the parent, head and body are children of the html element.

Another one:

<ul>
  <li>
      <a></a>
  </li>
  <li>
      <a></a>
  </li>
</ul>

In this example, ul is the parent and the li's are children. The li's are also parents, they are the parents of the a tags.

Think of it like a family tree Grandparent (ul) > Children (li) > Grandchildren (a)

You can find the answer to the challenge from the code in the first video. Look at the code for the img in main.css

Hope this helps :)

Thank you! James you are a legend! Im only 12 and have completed HTML and CSS on Khan Academy and Code academy! Thanks to you guys I can make my own website on Treehouse.... Respect guys ;)

No problem. Stick with it and by the time your 18 you could be the next Mark Zuckerberg :)

Thanks once again.... When I checked my email to see if anyone answered my question and when I saw two answers I went onto spotify and but celebrate good times!

Just asking...... How long have you been coding for???

About 3-4 years, been a member of treehouse for about 2 years.

Hi James it's me again.... Could you tell me I have done wrong. It's telling me to put the font-size to 0.9 em but it's not working. What's the problem

.classs-info { margin: 0; padding: none; list-style: none; font-size: 0.9em;

No worry James.... If you read this sorry for wasting your time, it's all sorted.

Hi Ibraheem. Glad you've sorted it. You should post a new thread next time instead of replying to this one so other people can see it as well. Just use the 'Ask' button on the Community page to start a new one. :)

Alright James. Never knew. Hope your well, i'll talk to you later. ;)