Community Forum 4
Question
Is it correct to say that the <body> element is nested within the <html> element?
Answer
That is correct! The <html> tag is the root element of every page and it should always have <head> and <body> child elements. The <head> and <body> elements are siblings to each other and children to the <html> parent.
Question
In steps 1 and 2 of this exercise, both <p> elements display in the same exact way. As it doesn’t seem like anything special happened here, what is the point of nesting the <p> element in a <div> element?
Answer
In this case, this is done purely for demonstrative purpose. In the future you will find that <div> elements are often used to group related content. This can serve to give a page some added structure and to allow for more modular styling.
Question
This exercise 246 says that child elements can inherit from their parents. What sorts of things can child elements inherit from their parents?
Answer
When you dive into our CSS course you will learn that child elements inherit most of their styling from their parent elements. In other words, most styles cascade down from parents to children.
Comments
Post a Comment