Bootstrap5 Tutorial
Bootstrap is the world's most popular front-end component library, used for developing responsive layouts and mobile-first WEB projects.
Bootstrap5 is currently the latest version of Bootstrap, an open-source toolkit for HTML, CSS, and JS development. It supports Sass variables and mixins, a responsive grid system, a large number of prebuilt components, and powerful JavaScript plugins, helping you quickly design and customize responsive, mobile-first sites.
Who should read this tutorial?
As long as you have basic knowledge of HTML and CSS, you can read this tutorial and go on to develop your own website. After finishing this tutorial, you will reach an intermediate level of using Bootstrap for web projects.
Knowledge you need before reading this tutorial:
Before you start reading this tutorial, you must have a basic knowledge of HTML, CSS, and JavaScript. If you are not yet familiar with these concepts, we recommend reading our tutorials first:
Why Use Bootstrap
-
Easy to get started:Anyone with a basic understanding of HTML and CSS can use Bootstrap very quickly.
-
Responsive design:Bootstrap can adapt to different platforms (mobile phones, tablets, and desktops).
-
Mobile first:In Bootstrap, mobile adaptation is a core part of the framework.
-
Browser compatibility:Bootstrap5 is compatible with all major browsers (Chrome, Firefox, Edge, Safari, and Opera). If you need to support IE11 and below, use Bootstrap4 or Bootstrap3.
Bootstrap5 Example
The following is a simple Bootstrap5 example:
Bootstrap5 Example
<
div
class
=
"
container-fluid p-5 bg-primary text-white text-center
"
<
h1
My First Bootstrap Page
h1
<
p
This is a responsive page, resize the browser to see the effect!
p
div
<
div
class
=
"
container mt-5
"
<
div
class
=
"
row
"
<
div
class
=
"
col-sm-4
"
<
h3
First column
h3
<
p
Runoob Tutorial
p
<
p
What you learn is not just technology, but also dreams!!!
p
div
<
div
class
=
"
col-sm-4
"
<
h3
Second column
h3
<
p
Runoob Tutorial
p
<
p
What you learn is not just technology, but also dreams!!!
p
div
<
div
class
=
"
col-sm-4
"
<
h3
The third column
h3
<
p
Runoob Tutorial
p
<
p
What you learn is not just technology, but also dreams!!!
p
div
div
div
Try it »
Bootstrap5 vs Bootstrap 3 & 4
Bootstrap5 is the latest version of Bootstrap, using new components, faster stylesheets, and faster responsiveness.
Bootstrap5 supports all major latest stable browser versions, but does not support Internet Explorer 11 and below.
The main difference between Bootstrap5 and Bootstrap 3 & 4 is that Bootstrap5 no longer depends on jQuery, using native JavaScript, of course, if we want to use it we can also import jQuery。
Bootstrap5 [does not support] browsers below IE11, Bootstrap4 dropped support for IE8 and iOS 6. If you need compatibility with older versions of browsers, please use Bootstrap3。
Note:Currently the official team still maintains Bootstrap 3 and Bootstrap 4, and we can continue to use them. However, no new features will be added to Bootstrap 3 & 4.