Bootstraps Navbars and Containers

I’m going over Bootstrap documentation. According to some sinnpets the conainer div should be nested in the Nav element.


But when looking at the code of the website itself it is the other way around. https://drive.google.com/open?id=0B_Z8B5WqCCg5aXdpM2hBX0dpWXM
So should the navbar be inide the container or the other way around?

It depends on what result you want to achieve. If you try in codepen you’ll see that depending on where you put the navbar (inside or outside the container), the elements will tend to go further on the sides or on the inside.

1 Like