Parent and child containers

How do you know or designate parent and child containers in CSS?

I am having trouble specifically with the Tribute Project user story #9: the img element should be centered within its parent element.

If you look at the tests, below the failing ones there is the reason of why it is failing, it gives often suggestions on what and how to fix (there can also be more than one reason, but only one is shown so you need to check back if it fails after changing the thing they say)

If you want a more concrete help you will need to share the link to your project

But theoretically, how do I know which is a parent and which is a child?

the child is the elment nested inside the other element, which we will call parent

for example here: <p><a href="#">Link</a> to something</p>
the p element is parent to the a element, and the a element is child to the p element

1 Like