Lesson 11: Button Groups in Bootstrap 5

What is the Btn-group in Bootstrap 5? How to create or use Buttons in Bootstrap 5? Lets find out together with TipsMake.com!

What is the Btn-group in Bootstrap 5? How to create or use Buttons in Bootstrap 5? Let's find out together with TipsMake.com!

 

Bootstrap has long been known as a popular and useful HTML and CSS framework for web development. Here you can easily find many beautiful templates for any project topic. And Button is one of them.

Whether you're developing web or application applications, buttons are a crucial component that you can't ignore, and absolutely need. They are the points or tools that allow users to navigate to their favorite pages.

If you frequently read news, watch movies, or listen to music, you're probably familiar with buttons. They often appear at the bottom of a page as navigation buttons or as page numbers for a specific section, or at the top of a page as a Play button to open music, and much more. All of these are forms of buttons. That's right, you can design buttons in many different ways. Below are some things you need to know about Button Groups in Bootstrap 5.

 

Button Grouping in Bootstrap allows you to group consecutive buttons into a single line. This is very useful if you want to organize buttons that are at the same level, on the same line, and with the same formatting. The grouped buttons will have the following formatting:

Horizontal node group

To create the button cluster as shown above, we will use the tag combined with the class .btn-group, with the complete code as follows:

 Ví dụ Bootstrap - QuanTriMang.com 

Button group in Bootstrap

The .btn-group class creates a group of buttons:

    

 

Tip : Instead of applying a uniform size to all buttons in the group, use a class .btn-group-lgfor the large button group or .btn-group-smfor the small button group:

 Ví dụ Bootstrap - QuanTriMang.com 

Button group size in Bootstrap

Add the class `.btn-group-*` for the large/small size button.

Large button:

   

Default button:

   

Small button:

    

 

You will see the following result:

Vertical node group

In many cases, you will need to present the buttons vertically instead of in rows as shown above. In this case, instead of using `.btn-group, you should use the `.btn-group-vertical.

 Ví dụ Bootstrap - QuanTriMang.com 

Button group in Bootstrap

The .btn-group-vertical class creates a group of nodes:

    

 

The HTML file above will display the following content:

Create multiple groups of buttons side-by-side.

By default, button groups are all "inline," so you can place multiple button groups side-by-side on a single line using the following command:

 Ví dụ Bootstrap - QuanTriMang.com 

Button group in Bootstrap

The default button groups will be formatted "inline," which makes them appear side-by-side when you have multiple groups:

     

The result will be as follows:

Nested button groups and dropdown menus

 

Nested button groups are used to create dropdown menus; you can see that a basic nested dropdown menu will look like this:

The HTML code to create the menu shown above is:

 Ví dụ Bootstrap - QuanTriMang.com 

Dropdown Menu Group

Nested button groups to create a dropdown menu:

  

That's just an example; to learn more about each type of dropdown menu, please continue reading the following articles!

Related posts
Other Program articles
  • Lesson 10: Buttons in Bootstrap 5 - How to create different types of buttons in Bootstrap

    btn php hay button bootstrap 5 là gì? bài viết sẽ tổng hợp cho bạn các loại button và cách tạo chúng trong bootstrap như thế nào nhé!
  • Lesson 9: Alerts in Bootstrap 5

    alert bootstrap 5 là gì? bootstrap 5 alert là một thành phần quan trọng trong phát triển web, ứng dụng. dưới đây là mọi điều bạn cần biết về alert trong bootstrap 5.
  • Lesson 8: Jumbotron in Bootstrap 5

    trong bootstrap, jumbotron là một box màu xám chứa văn bản, với mục đích là tăng thêm sự chú ý cho văn bản trong đó. khi cảm thấy văn bản/thông tin nào thật quan trọng, cần phải làm cho nó xuất hiện thật lớn, thật gây chú ý, bạn chỉ cần viết nó trong jumbotron.
  • Lesson 6: Tables in Bootstrap 5

    table trong bootstrap là gì? cách tạo table trong bootstrap như thế nào? hãy cùng tipsmake.com.com tìm hiểu nhé!
  • Lesson 5: Colors in Bootstrap 5

    màu trong bootstrap được sử dụng như thế nào? Ở bài viết này, hãy cùng nhau tìm hiểu mọi điều về màu bootstrap nhé!
  • Lesson 4: Typography in Bootstrap 5

    căn giữa bootstrap 5 không khó. Đó là một phần trong typography. dưới đây là mọi điều bạn cần biết về typography trong bootstrap 5.
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