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 trialIbraheem Saeed
432 PointsI 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
8,820 PointsA 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>
Arturo Espinoza
9,181 PointsTake a look at this. It might help. https://teamtreehouse.com/community/add-css-that-will-allow-all-images-to-fill-their-parent-element
Ibraheem Saeed
432 PointsThank 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 ;)
James Anwyl
Full Stack JavaScript Techdegree Graduate 49,960 PointsHi 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 :)
Ibraheem Saeed
432 PointsThank 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 ;)
James Anwyl
Full Stack JavaScript Techdegree Graduate 49,960 PointsNo problem. Stick with it and by the time your 18 you could be the next Mark Zuckerberg :)
Ibraheem Saeed
432 PointsThanks 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!
Ibraheem Saeed
432 PointsJust asking...... How long have you been coding for???
James Anwyl
Full Stack JavaScript Techdegree Graduate 49,960 PointsAbout 3-4 years, been a member of treehouse for about 2 years.
Ibraheem Saeed
432 PointsHi 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.
James Anwyl
Full Stack JavaScript Techdegree Graduate 49,960 PointsHi 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. :)
Ibraheem Saeed
432 PointsAlright James. Never knew. Hope your well, i'll talk to you later. ;)
Ibraheem Saeed
432 PointsIbraheem Saeed
432 PointsThank 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 ;)