Container div


What is the reasoning for having container divs under nav and jumbotron?
Should container be on top of each one of those?


We call where the container divs are positioned as INSIDE their parent divs.

    <div class="nav">
      <div class="container">
      ... your nav code goes in here
      </div> <!-- ends container -->
    </div> <!-- ends nav -->

    <div class="jumbotron">
      <div class="container">
      ... your jumbotron code goes in here
      </div> <!-- ends container -->
    </div> <!-- ends jumbotron -->

Having those container divs will help you style the content without affecting the parent divs. When you get to the Bootstrap exercises you will see that Bootstrap makes use of containers.


Thank you. I assumed since I've seen many examples of container divs that surround the entire body of a div, that they were supposed to be outside of the parent div.


You can use them in both ways. It depends on the outcome you are looking for.


Thanks again!
I saw the significance of container placement when I went through the bootstrap exercises. My initial confusion stemmed from the fact that I thought the container was supposed to "contain" the div & not vice versa. Before using code academy, I was always taught container 1st, then div. It's taking awhile but I think i'm getting it.