Jake AlmendarezFront End Web Development Techdegree Student 4,249 Points
for some reason the font size is still applied to all the elements even if after i add h1 and span tags.
for some reason the font size is still applied to all the elements even if after i add h1 and span tags. Is it because the html inherited the font size?
Gergely BoczTreehouse Moderator 13,397 Points
Can you share your code so that i can see what you did?
My guess is, that you put the h1 and the span tags to the wrong place. For example if you put the h1 tag after the ul, along with the *li list items, then it became their sibling, so they share a common parent, therefore the body still has only 1 "direct child", as the h1 would be a grandchildren of the body, along with the li elements.
So the :only-child selector selects those elements, that don't have a sibling: a node with which our selected element shares a parent. If such a node exists, then they are not selected by the :only-child selector.
Hope it helps! If I didn't answer your question, please share your code so that i can take a look!