Bootstrap 5 Learning


What is bootstrap ?

Bootstrap 5 is the fifth and latest version of the popular front-end framework called Bootstrap, which is used for building responsive and mobile-first web applications. Bootstrap is an open-source toolkit developed by Twitter, and it provides a collection of CSS and JavaScript components that can be easily integrated into web projects to streamline the development process and create modern, visually appealing user interfaces.


Advantages of Bootstrap

Bootstrap is the most popular HTML, CSS, and JavaScript framework
Bootstrap is completely free to download and use!
Easy and Highly Customizable
Very good Responsive Grid System
Various built-in Components
Bootstrap Can be Extended in various projects


Responsive Web Design Breakpoints with Bootstrap 5

Extra Small (xs): This breakpoint is for screens with a maximum width of 575.98 pixels. It is typically used for smartphones and other small mobile devices.
Small (sm): This breakpoint is for screens with a width of 576 pixels or larger. It is often used for small tablets and larger smartphones.
Medium (md): This breakpoint is for screens with a width of 768 pixels or larger. It is commonly used for tablets and larger devices.
Large (lg): This breakpoint is for screens with a width of 992 pixels or larger. It is often used for desktops and larger screens.
Extra Large (xl): This breakpoint is for screens with a width of 1200 pixels or larger. It is commonly used for larger desktop screens.
Extra Extra Large (xxl): This breakpoint is for screens with a width of 1400 pixels or larger. It is used for extra large screens.


container and breakpoint


container example


container-fluid example


container-xs example


container-sm example


container-md example


container-lg example


container-xl example


container-xxl example


Grid in Bootstrap


The grid system in Bootstrap 5 is a powerful and flexible layout system that allows developers to create responsive and fluid grids for web pages or applications. It is based on a 12-column grid system that can be easily customized to create various column layouts depending on the screen size or device.

Column 12

Column 6
Column 6

Column 4
Column 4
Column 4

Column 3
Column 3
Column 3
Column 3

Column 2
Column 2
Column 2
Column 2
Column 2
Column 2

Column 1
Column 1
Column 1
Column 1
Column 1
Column 1
Column 1
Column 1
Column 1
Column 1
Column 1
Column 1

Column sm 6
Column sm 6

Column md 6
Column md 6

Column lg 6
Column lg 6

Column xl 6
Column xl 6

Column xll 6
Column xll 6


Columns in Bootstrap


In Bootstrap 5, columns are an essential part of the grid system that allows developers to create responsive and flexible layouts for web pages or applications. Columns are used to divide the width of a container into equal or varying parts, which can be used to arrange content in a structured manner.


align items start


In Bootstrap 5, align-items-start is a CSS class used to vertically align content to the top of a column within a grid row. It is used in combination with the Flexbox layout classes to control the alignment of content within columns.


1
2
3
4

align items center


In Bootstrap 5, align-items-center is a CSS class used to vertically align content to the center of a column within a grid row. It is used in combination with the Flexbox layout classes to control the alignment of content within columns.


1
2
3
4

align items end


In Bootstrap 5, align-items-end is a CSS class used to vertically align content to the bottom of a column within a grid row. It is used in combination with the Flexbox layout classes to control the alignment of content within columns.


1
2
3
4

align items baseline


1
2
3
4

align items stretch


1
2
3
4

align self


In Bootstrap 5, align-self is a set of CSS classes that can be used to individually control the vertical alignment of content within a column in a grid row. These classes are used in combination with the Flexbox layout classes and provide more granular control over the alignment of individual columns.


align-self-start: Aligns the content to the top of the column.
align-self-center: Aligns the content to the center of the column vertically.
align-self-end: Aligns the content to the bottom of the column.
align-self-stretch: Stretches the content to fill the height of the column.

justify content


justify-content is a CSS property that is commonly used in conjunction with Bootstrap 5's flexbox utilities to control the alignment of flex items along the main axis (horizontal axis) of a flex container. In Bootstrap 5, the justify-content property can be applied using various classes to achieve different alignment options.


justify content start

This class aligns the flex items to the start of the flex container, pushing them towards the beginning of the main axis.

1
2
3

justify content center

This class aligns the flex items to the center of the flex container along the main axis.

1
2
3

justify content end

This class aligns the flex items to the end of the flex container, pushing them towards the end of the main axis.

1
2
3

justify content between

This class evenly distributes the flex items along the main axis, with the first item aligned to the start and the last item aligned to the end. This creates equal spacing between adjacent flex items.

1
2
3

justify content around

This class evenly distributes the flex items along the main axis, with equal spacing around each item. This creates equal spacing between adjacent and outermost flex items.

1
2
3

justify content evenly

This class evenly distributes the flex items along the main axis, with equal spacing between all flex items, including the outermost items.

1
2
3

order


In Bootstrap 5, the order class is used to control the order of flex items within a flex container. It allows you to visually rearrange the order of elements displayed in a flexbox layout, without changing the actual HTML structure. The order class can be applied to individual flex items using numeric values to specify their display order.


1
2
3

8