Home >Web Front-end >CSS Tutorial >How can I create a two-row navbar in Bootstrap 4?

How can I create a two-row navbar in Bootstrap 4?

Susan Sarandon
Susan SarandonOriginal
2024-12-10 00:55:10295browse

How can I create a two-row navbar in Bootstrap 4?

Bootstrap 4 navbar with 2 rows

In Bootstrap 4, it's possible to create a navbar with two rows by using the flexbox utility classes. Here's how you can achieve this:

  1. Add the flex-column class to the .navbar-collapse div. This will stack the two navbars vertically.

  1. Set the flex-direction: column property on the .navbar-brand element. This will align the logo vertically with the navbar links.

  1. Optionally, you can add the flex-row class to the second navbar to align the icons horizontally.

    Here's an updated version of your code: