Jump to content

Bootstrap 4 navbar full width?

mrchow19910319
Go to solution Solved by HarryNyquist,
5 hours ago, mrchow19910319 said:

wait.... why container-fluid stopped it being full width??? wasnt it supposed to make the whole page responsive?? 

container-fluid makes the page 100% wide on all viewport sizes. container has the responsive breakpoints built-in so as you resize the viewport, it changes the max-width of the <div> to various different pixel widths (the exact widths are here)


A navbar is fluid by default, so it should go above any containers, and you apply the responsive classes to the navbar items to make things change (documentation for that here)

Remove the container-fluid class or put the nav-bar above it.

 

<nav class="navbar navbar-dark bg-dark">
  <a class="navbar-brand sticky-top" href="#">Start Bootstrap</a>        
</nav>

 

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, Cruorzy said:

Remove the container-fluid class or put the nav-bar above it.

 


<nav class="navbar navbar-dark bg-dark">
  <a class="navbar-brand sticky-top" href="#">Start Bootstrap</a>        
</nav>

 

wait.... why container-fluid stopped it being full width??? wasnt it supposed to make the whole page responsive?? 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, mrchow19910319 said:

wait.... why container-fluid stopped it being full width??? wasnt it supposed to make the whole page responsive?? 

container-fluid makes the page 100% wide on all viewport sizes. container has the responsive breakpoints built-in so as you resize the viewport, it changes the max-width of the <div> to various different pixel widths (the exact widths are here)


A navbar is fluid by default, so it should go above any containers, and you apply the responsive classes to the navbar items to make things change (documentation for that here)

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×