HTML Nesting
Hierarchy in HTML
Look at the HTML below. Do you see how the container could be called the parent of the three cards? The cards are then children of the container. This is an example of nested HTML.
HTML
CSS
Try it out
Copy the HTML and CSS above into a new CodePen.
Notice in the browser preview how the nesting becomes visually apparent.
Also, notice how the indentation in the HTML is really helpful to see the proper structure. Technically the indentation does not need to be there, but it is a good programming practice.
Add a parent
<div>
element with a class of "outer-container" to the container and style it with a solid border line. Use good indentation in your HTML.
Last updated