Lesson 20: Navs in Bootstrap 5

Navs in Bootstrap 5 are a component that helps you design navigation on websites, applications, or software. Below is how to use Navs in Bootstrap 5.

Navs in Bootstrap 5 are a component that helps you design navigation on websites, applications, or software. Below is how to use Navs in Bootstrap 5 .

 

Navigation menu

If you want to create a simple horizontal menu, add a class .nav to the element, followed by a class .nav-itemfor each element.

and add classes .nav-linkto their links. Basic code:

For example:

 Bootstrap Example 

Nav

Basic horizontal menu for QuanTriMang.com:

 

Adjust navigation menu

Add classes .justify-content-centerto adjust the navigation menu to be centered and class .justify-content-endto adjust it to be on the right. Basic code:

For example:

 Bootstrap Example 

Nav for TipsMake.com.com in Bootstrap

Left-hand navigation menu (default):

Navigation menu in the middle:

Right-hand navigation menu:

 

Vertical navigation menu

Add a class .flex-columnto create vertical navigation. Basic code:

 

For example:

 Bootstrap Example 

Vertical navigation for TipsMake.com.com

Tab

Transform the nav menu into navigation tabs using the class .nav-tabs. Add the class .activeto the active/current link. If you want the tabs to be switchable, try applying the basic code below:

 

For example:

 Bootstrap Example 

Navigation tab for QuanTriMang.com

Pills

Transform the navigation menu into navigation pills (similar to buttons) using the `` class .nav-pills. If you want to convert the pills, follow this basic code:

For example:

 Bootstrap Example 

Navigation buttons for QuanTriMang.com

Align tab/pill

Align tabs/pills using the same class .nav-justified(same width):

. .

 

For example:

 Bootstrap Example 

Align navigation tabs/pills for QuanTriMang.com

Use the `.nav-justified` class to align the button-based navigation menu:

 

Align all tabs:

Pill with dropdown menu

Sample code:

For example:

 Bootstrap Example 

Tab-based buttons with dropdown menus for QTM

 

Tabs with dropdown menus

Sample code:

For example:

 Bootstrap Example 

Tab with dropdown menu for QuanTriMang.com

Dynamic/Toggle tabs

To make tabs toggleable, add the attribute data-toggle="tab" to each link. Then, add a class .tab-panewith a unique ID for each tab and place them inside the element containing the class .tab-content.

If you want the tab to fade when clicked, add a class .fadeto it .tab-pane. Sample code:

  . . . 

For example:

 Bootstrap Example 

Tabs can be switched for QuanTriMang.com

 
  

HOME

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

 

Menu 1

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

 

Menu 2

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.

 

Dynamic/Switchable Pill

You apply the same code template as above to the pill, just change the `data-toggle` property to `data-toggle="pill"` :

  . . . 

For example:

 Bootstrap Example 

Pill can be converted for QuanTriMang.com

 
  

Homepage

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

 

Menu 1

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

 

Menu 2

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.

Above are all the ways to create a navigation menu using Bootstrap 5. As you can see, it's not too difficult, right?

Other Program articles
  • Lesson 19: How to use Collapse in Bootstrap 5

    collapse trong bootstrap 5 giúp bạn ẩn, hiện nội dung trên trang bằng một số class và plugin javascript. dưới đây là những điều bạn cần biết về collapse trong bootstrap 5.
  • Lesson 18: Creating a Dropdown Menu in Bootstrap 5

    dropdown hay tạo menu xổ xuống trong bootstrap 5 là một tính năng thú vị bạn không nên bỏ qua. dưới đây là cách dùng dropdown trong bootstrap 5.
  • Lesson 16: List Groups in Bootstrap 5

    list group hay nhóm danh sách trong bootstrap 5 là một thành phần linh hoạt và mạnh mẽ để hiển thị một chuỗi thông tin.hãy cùng quantrimang.com tìm hiểu cách dùng list-group trong bootstrap 5 nhé!
  • Lesson 15: Pagination in Bootstrap 5

    phần bài học bootstrap cơ bản này sẽ thảo luận về tính năng phân trang hay pagination. bootstrap 5 xử lý danh sách không theo đúng thứ tự giống như rất nhiều các nhân tố khác trên giao diện.
  • Lesson 14: Spinner in Bootstrap 5

    spinner trong boostrap 5 là gì? cách dùng spinner trong boostrap 5 như thế nào? hãy cùng tipsmake.com tìm hiểu nhé!
  • Lesson 13: Progress Bars in Bootstrap 5

    trong bài viết này, quantrimang sẽ tiếp tục hướng dẫn bạn sử dụng bootstrap để tạo các thanh tiến trình - progress bar.
Category

System

Windows XP

Windows Server 2012

Windows 8

Windows 7

Windows 10

Wifi tips

Virus Removal - Spyware

Speed ​​up the computer

Server

Security solution

Mail Server

LAN - WAN

Ghost - Install Win

Fix computer error

Configure Router Switch

Computer wallpaper

Computer security

Mac OS X

Mac OS System software

Mac OS Security

Mac OS Office application

Mac OS Email Management

Mac OS Data - File

Mac hardware

Hardware

USB - Flash Drive

Speaker headset

Printer

PC hardware

Network equipment

Laptop hardware

Computer components

Advice Computer

Game

PC game

Online game

Mobile Game

Pokemon GO

information

Technology story

Technology comments

Quiz technology

New technology

British talent technology

Attack the network

Artificial intelligence

Technology

Smart watches

Raspberry Pi

Linux

Camera

Basic knowledge

Banking services

SEO tips

Science

Strange story

Space Science

Scientific invention

Science Story

Science photo

Science and technology

Medicine

Health Care

Fun science

Environment

Discover science

Discover nature

Archeology

Life

Travel Experience

Tips

Raise up child

Make up

Life skills

Home Care

Entertainment

DIY Handmade

Cuisine

Christmas

Application

Web Email

Website - Blog

Web browser

Support Download - Upload

Software conversion

Social Network

Simulator software

Online payment

Office information

Music Software

Map and Positioning

Installation - Uninstall

Graphic design

Free - Discount

Email reader

Edit video

Edit photo

Compress and Decompress

Chat, Text, Call

Archive - Share

Electric

Water heater

Washing machine

Television

Machine tool

Fridge

Fans

Air conditioning

Program

Unix and Linux

SQL Server

SQL

Python

Programming C

PHP

NodeJS

MongoDB

jQuery

JavaScript

HTTP

HTML

Git

Database

Data structure and algorithm

CSS and CSS3

C ++

C #

AngularJS

Mobile

Wallpapers and Ringtones

Tricks application

Take and process photos

Storage - Sync

Security and Virus Removal

Personalized

Online Social Network

Map

Manage and edit Video

Data

Chat - Call - Text

Browser and Add-on

Basic setup