Jump to content

Bootstrap 4 navbar full width?

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)

Have no idea how to make navbar full width here. 

Do I have to change the CSS of the page? 

Or there is a class I can use in bootstrap? 

 

https://codepen.io/zhouxiang19910319/pen/ZxmZQd?editors=1100

 

 

5b0fd53404315_ScreenShot2018-05-31at6_57_38PM.thumb.png.fbeca68f800f6512775319fbd319431c.png

 

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

Link to comment
https://linustechtips.com/topic/932721-bootstrap-4-navbar-full-width/
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 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 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

×