Lesson 38: Grid Systems from Stacked to Horizontal in Bootstrap 5

The grid system in Bootstrap 5 is quite diverse. In this lesson, we will focus on the two most common grid layouts!

The grid system in Bootstrap 5 is quite diverse. In this lesson, we will focus on the two most common grid layouts in Bootstrap 5 !

 

Now let's create a basic grid system, starting with stacking on smaller devices, before moving on to horizontal arrangement on larger devices.

The example below shows a two-column layout 'stacked to landscape'. This means it will split the screen in half on all screen sizes, except for screens that are too small. In that case, it will automatically stack (100%).

Basic code:

Lorem ipsum.

Sed ut perspiciatis.

For example:

 Bootstrap Example 

Example of a Grid

This example illustrates a 50%/50% split ratio across small, medium, large, xlarge, and xxlarge devices. On ultra-small devices, it will overlap (100% width).

Adjust the size of your browser window to see the difference.

 TipsMake.com. Downloadvn. 

 

Tip: The numbers in the class .col-sm-*indicate the number of columns to merge (out of 12). Therefore, .col-sm-1merge 1 column, .col-sm-4merge 4 columns, .col-sm-6merge 6 columns…

Note: Ensure the total number of added columns is limited to a maximum of 12. You don't need to use all 12 available columns.

Tip: You can convert any full-width layout into a responsive fixed-width layout by changing the class .container-fluidto . container. For example:

Lorem ipsum.

Sed ut perspiciatis.

Automatic column layout

Bootstrap 5 has an easy way to create columns of equal width for all devices: simply remove the word count .col-size-*and use classes only on certain col.col-size elements . Bootstrap will determine the number of columns available. Each column has the same width. The class size (sm, md…) determines when the column should be responsive. Sample code:

 1 of 2 2 of 2  1 of 4 2 of 4 3 of 4 4 of 4 1 of 2

 

For example:

 Bootstrap Example 

Two columns : 50% width on all screens except ultra-small (100% width on screens with a width less than 576px )

 1 of 2 2 of 2 

Four columns : 25% width on all screens, except for extra small (100% width on screens with a width less than 576px )

 1 of 4 2 of 4 3 of 4 4 of 4 

Grid systems are crucial in web development. You'll have many different grid configuration options when using Bootstrap 5. The examples above are two simple grid creation examples that can be applied to any website or application. Hopefully, this article is helpful to you.

Related posts
Other Program articles
  • Lesson 37: Form Validation in Bootstrap 5

    form validation hay xác thực biểu mẫu cung cấp phản hồi giá trị có người dùng. Ở bài học cách dùng bootstrap này, hãy cùng nhau tìm hiểu cách thêm validation vào form trong bootstrap 5 như thế nào nhé!
  • Lesson 36: Form Floating Label in Bootstrap 5

    floating labels là phần tử cho bạn cách tạo những nhãn biểu mẫu đơn giản, nổi lên trên các trường nhập. dưới đây là cách tạo floating label trong bootstrap 5.
  • Lesson 35: Input Groups in Bootstrap 5

    nhóm input hay input group trong bootstrap 5 mang tới cho bạn cách mở rộng một input control. dưới đây là cách dùng input group trong bootstrap 5.
  • Lesson 33: Checkboxes and Radio Buttons in Bootstrap 5

    checkbox và button radio là hai thành phần hữu ích khi xây dựng các mục list trong website. dưới đây là cách tạo checkbox và button radio trong bootstrap 5.
  • Lesson 32: Selection Menus in Bootstrap 5

    bootstrap 5 sẽ giúp bạn thêm tính năng hoặc thiết kế lại ô lựa chọn cho web. dưới đây là cách tạo menu lựa chọn trong bootstrap 5.
  • Lesson 31: Creating Forms in Bootstrap 5

    form trong bootstrap 5 giúp lập trình viên dễ dàng xây dựng các biểu mẫu cho web. dưới đây là cách tạo form bằng 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