Where to place Container/Container-fluid class

Where to place Container/Container-fluid class
0.0 0


I was wondering if anyone could help me with these questions:

-Where should <div class="container-fluid>"
or <div class="container>" be placed? I seem to recall that in the freeCodeCamp exercises, I placed it right after <body>.

-If I’m creating a navigation bar, would I be able to start with something like this:

<div class="container-fluid"> or <div class="container">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="navbar-header">

Most codes I see don’t have <header> tags. Also the <nav> tags come BEFORE <div class="container"> or <div class="container">, not after.

Many thanks in advance!


You don’t need to use container for nav bars.
Just do something like this

<nav class="nav">
  <a class="nav-link active" href="#">Active</a>
  <a class="nav-link" href="#">Link</a>
  <a class="nav-link" href="#">Link</a>
  <a class="nav-link disabled" href="#">Disabled</a>

Bootstrap Navs


That’s really quick! Thank you!


forgot to mention that you “can” use a container i edited the pen to show.