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
Release: 2024-12-10 00:55:10
Original
260 people have browsed it

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:

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template