I'm Jason D. Nutt,

a passionate web developer 5 years into a mission to push the boundaries of technology and creativity.

Alongside that, I've mastered the powerful features of React and TypeScript during my postgraduate studies, expanding my toolkit for building dynamic, efficient web applications.

With a solid foundation in front-end web development from my tech degree at Treehouse, I've delved, dived, jumped....went way down into... deep into the world of web technologies.

This is how I learned Bootstrap5, following W3 Schools Curriculum, I created the website that gets built out as the result of documenting the journey through the documentation.
This is what I recommend for any beginner that really wants to know a framework...write it out while building what it says...as we complete the courses and then I will have in one repo a code snippet for every single feature of the framework (WITH SOLID NOTES!)
while solidifying my capabilities, a flawless plan!

The .container-fluid class provides a full width container, spanning the entire width of the viewport.

Here is how Grid looks with Bootstrap5

Resize this responsive page to see the effect!

Column 1

Lorem ipsum dolor sit amet, consectetur adipisicing elit...

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...

Column 2

Lorem ipsum dolor sit amet, consectetur adipisicing elit...

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...

Column 3

Lorem ipsum dolor sit amet, consectetur adipisicing elit...

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...

Keyboard Inputs

To indicate input that is typically entered via the keyboard, use the kbd element:

Use ctrl + p to open the Print dialog box.

Multiple Code Lines

For multiple lines of code, use the pre element:

    Text in a pre element
    is displayed in a fixed-width
    font, and it preserves
    both      spaces and
    line breaks.
    

Contextual Backgrounds

Use the contextual background classes to provide "meaning through colors".

Background Color with Contrasting Text Color

This text is important.

This text indicates success.

This text represents some information.

This text represents a warning.

This text represents danger.

Secondary background color.

Dark grey background color.

Light grey background color.

Contextual Colors

Use the contextual classes to provide "meaning through colors":

This text is muted.

This text is important.

This text indicates success.

This text represents some information.

This text represents a warning.

This text represents danger.

Secondary text.

This text is dark grey.

Default body color (often black).

This text is light grey (on white background).

^This is grey on a white bg^

This text is white (on white background).

^This is white on a white bg^

Opacity Text Colors

Add 50% opacity for black or white text with the .text-black-50 or .text-white-50 classes:

Black text with 50% opacity on white background

White text with 50% opacity on black background

Basic Table

The .table class adds basic styling (light padding and horizontal dividers) to a table:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com

Striped Rows

The .table-striped class adds zebra-stripes to a table:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com

Bordered Table

The .table-bordered class adds borders on all sides of the table and the cells:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com

Hover Rows

The .table-hover class enables a hover state (grey background on mouse over) on table rows:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com

Black/Dark Table

The .table-dark class adds a black background to the table:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com

Dark Striped Table

Combine .table-dark and .table-striped to create a dark, striped table:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com

Hoverable Dark Table

The .table-hover class adds a hover effect (grey background color) on table rows:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com

Borderless Table

The .table-borderless class removes borders from the table:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com

Contextual Classes

Contextual classes can be used to color the table, table rows or table cells. The classes that can be used are: .table-primary, .table-success, .table-info, .table-warning, .table-danger, .table-active, .table-secondary, .table-light and .table-dark:

Firstname Lastname Email
Default Defaultson def@somemail.com
Primary Joe joe@example.com
Success Doe john@example.com
Danger Moe mary@example.com
Info Dooley july@example.com
Warning Refs bo@example.com
Active Activeson act@example.com
Secondary Secondson sec@example.com
Light Angie angie@example.com
Dark Bo bo@example.com

Table Head Colors

You can use any of the contextual classes to only add a color to the table header:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com
Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com

Small Table

The .table-sm class makes the table smaller by cutting cell padding in half:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com

Responsive Table

The .table-responsive class adds a scrollbar to the table when needed:

# Firstname Lastname Age City Country Sex Example Example Example Example Example Example Example Example Example Example Example Example
1 Anna Pitt 35 New York USA Female Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes

Rounded Corners

The .rounded class adds rounded corners to an image:

W3 progress.png

Circle

The .rounded-circle class shapes the image to a circle:

w3 progress.png

Thumbnail

The .img-thumbnail class creates a thumbnail of the image:

w3 progress.png

Centered Image

Center an image by adding the utility classes .mx-auto (margin:auto) and .d-block (display:block) to the image:

next icon

Image

The .img-fluid class makes the image scale nicely to the parent element (resize the browser window to see the effect):

JNUTT logo

Example of Jumbotron

Jumbotron Example

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat..

Alerts

Alerts are created with the .alert class, followed by a contextual color classes:

Success! This alert box could indicate a successful or positive action.
Info! This alert box could indicate a neutral informative change or action.
Warning! This alert box could indicate a warning that might need attention.
Danger! This alert box could indicate a dangerous or potentially negative action.
Primary! Indicates an important action.
Secondary! Indicates a slightly less important action.
Dark! Dark grey alert.
Light! Light grey alert.

Alert Links

Add the alert-link class to any links inside the alert box to create "matching colored links".

Success! You should read this message.
Info! You should read this message.
Warning! You should read this message.
Danger! You should read this message.
Primary! You should read this message.
Secondary! You should read this message.
Dark! You should read this message.
Light! You should read this message.

Alerts

The button with class="btn-close" and data-bs-dismiss="alert" is used to close the alert box.

The alert-dismissible class aligns the button to the right.

Success! This alert box could indicate a successful or positive action.
Info! This alert box could indicate a neutral informative change or action.
Warning! This alert box could indicate a warning that might need attention.
Danger! This alert box could indicate a dangerous or potentially negative action.
Primary! Indicates an important action.
Secondary! Indicates a slightly less important action.
Dark! Dark grey alert.
Light! Light grey alert.

Animated Alerts

The .fade and .show classes adds a fading effect when closing the alert message.

Success! This alert box could indicate a successful or positive action.
Info! This alert box could indicate a neutral informative change or action.
Warning! This alert box could indicate a warning that might need attention.
Danger! This alert box could indicate a dangerous or potentially negative action.
Primary! Indicates an important action.
Secondary! Indicates a slightly less important action.
Dark! Dark grey alert.
Light! Light grey alert.

Button Styles

Button Elements

Link Button

Button Outline

Button Sizes

Block Level Buttons

To create a block level button that spans the entire width of the parent element, use the .d-grid "helper" class on the parent element:

Block Level Buttons

If you have many block-level buttons, you can control the space between them with the .gap-* class:

Button States

Disabled Link

Spinner Buttons

Add spinners to buttons:

Button Group

The .btn-group class creates a button group:

Button Groups Sizes

Add class .btn-group-* to size all buttons in a button group.

Large Buttons:


Default Buttons:


Small Buttons:

Vertical Button Group

Use the .btn-group-vertical class to create a vertical button group:

Button Group

Button groups are "inline" by default, which makes them appear side by side when you have multiple groups:

Nesting Button Groups

Nest button groups to create dropdown menus:

Badges

Example heading New

Example heading New

Example heading New

Example heading New

Example heading New
Example heading New

Contextual Badges

Primary Secondary Success Danger Warning Info Light Dark

Pill Badges

Primary Secondary Success Danger Warning Info Light Dark

Badge inside a Button

Basic Progress Bar

To create a default progress bar, add a .progress class to a container element and add the progress-bar class to its child element. Use the CSS width property to set the width of the progress bar:

Progress Bar Height

The height of the progress bar is 1rem (16px) by default. Use the CSS height property to change the height:



Progress Bar With Label

70%

Colored Progress Bars

Use any of the contextual color classes to change the color of the progress bar:









Striped Progress Bars

The .progress-bar-striped class adds stripes to the progress bars:





Animated Progress Bar

Add the .progress-bar-animated class to animate the progress bar:

Multiple Progress Bars

Create a stacked progress bar by placing multiple bars into the same div with class="progress":

Free Space
Warning
Danger

Spinners

To create a spinner/loader, use the .spinner-border class:

Colored Spinners

Use any text color utilites to add a color to the spinner:

Growing Spinners

Use the .spinner-grow class if you want the spinner/loader to grow instead of "spin":

Spinner Size

Use .spinner-border-sm or .spinner-grow-sm to create a smaller spinner:

Spinner Buttons

Add spinners to buttons:

Pagination

To create a basic pagination, add the .pagination class to an ul element. Then add the .page-item to each li element and a .page-link class to each link inside li:

Pagination - Active State

Add class .active to let the user know which page he/she is on:

Pagination - Disabled State

Add class .disabled if a page for some reason is disabled:

Pagination - Sizing

Add class .pagination-lg for larger blocks or .pagination-sm for smaller blocks.

Large:

Default:

Small:

Pagination

Use utilitiy classes to change the alignment of the pagination:

Breadcrumbs

The .breadcrumb class indicates the current page's location within a navigational hierarchy:

Basic List Group

Active Item in a List Group

List Group With Linked Items

First item Second item Third item

List Group With a Disabled Item

The disabled class adds a lighter text color to the disabled item. And if used on links, it will remove the default hover effect.

Disabled item Disabled item Third item

Flush / Remove Borders

Use the .list-group-flush class to remove some borders and rounded corners:

Numbered List Group

Use the .list-group-numbered class to create list items with numbers in front of them:

  1. First item
  2. Second item
  3. Third item

Horizontal List Groups

The .list-group-horizontal class displays the list items horizontally instead of vertically:

List Group With Contextual Classes

Linked Items With Contextual Classes

Move the mouse over the linked items to see the hover effect:

Action item Success item Secondary item Info item Warning item Danger item Primary item Dark item Light item

List Group With Badges

Combine .badge classes with utility/helper classes to add badges inside the list group:

Basic Card

Basic card

Card Header and Footer

Header
Content

Cards with Contextual Classes

Basic card

Primary card

Success card

Info card

Warning card

Danger card

Secondary card

Dark card

Light card

Card titles, text, and links

Use .card-title to add card titles to any heading element. The .card-text class is used to remove bottom margins for a p element if it is the last child (or the only one) in card-body. The .card-link class adds a blue color to any link, and a hover effect.

Card title

Some example text. Some example text.

Card link Another link

Card Image

Image at the top (card-img-top):

Card image

John Doe

Some example text some example text. John Doe is an architect and engineer

See Profile

Image at the bottom (card-img-bottom):

Jane Doe

Some example text some example text. Jane Doe is an architect and engineer

See Profile
Card image

Card Image Overlay

Turn an image into a card background and use .card-img-overlay to overlay the card's text:

Card image

John Doe

Some example text some example text. Some example text some example text. Some example text some example text. Some example text some example text.

See Profile

Dropdowns

The .dropdown class is used to indicate a dropdown menu.

Use the .dropdown-menu class to actually build the dropdown menu.

To open the dropdown menu, use a button or a link with a class of .dropdown-toggle and data-toggle="dropdown".

Dropdowns

The .dropdown-divider class is used to separate links inside the dropdown menu with a thin horizontal line:

Dropdowns

The .dropdown-header class is used to add headers inside the dropdown menu:

Dropdowns

The .active class adds a blue background color to the active link.

The .disabled class disables a dropdown item (grey text color and a no-parking-sign on hover).

Dropdowns

Add the .dropend class next to the dropdown menu to right-align the dropdown. Note that the caret/arrows is added automatically:

Dropdowns

Add the .dropstart class next to the dropdown menu to left-align the dropdown. Note that the caret/arrow is added automatically. Also note that we float the dropdown to the right:

Dropdowns

Add the .dropdown-menu-end class to .dropdown-menu to right-align the dropdown menu.

Dropdowns

The .dropup class makes the dropdown menu expand upwards instead of downwards:

It must be room for the dropup menu to grow. That is why we add some extra lorem ipsum text.

Lorem ipsum one more time!

Dropdowns

The .dropdown-item-text class is used to add plain text to a dropdown, or used on links for default link styling.

Nesting Button Groups

Nest button groups to create dropdown menus:

Vertical Button Group with Dropdown

Simple Collapsible

Click on the button to toggle between showing and hiding content.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Show Collapsible Content By Default

Add the show class next to the collapse class to show the content by default.

Click on the button to toggle between showing and hiding content.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Accordion Example

Note: The data-bs-parent attribute makes sure that all collapsible elements under the specified parent will be closed when one of the collapsible item is shown.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Nav

Basic horizontal menu:

Nav

Left-aligned nav (default):

Centered nav:

Right-aligned nav:

Vertical Nav

Use the .flex-column class to create a vertical nav:

Navigation Tabs

Turn the nav menu into navigation tabs with the .nav nav-tabs class. Add the active class to the active/current link. If you want the tabs to be togglable, see the last example on the tutorial page.

Navigation Pills

Turn the nav menu into navigation pills with the .nav nav-pills class:

Justified Tabs/Pills

To justify tabs/pills (equal width), use the .nav-justified class:


Justified tabs:

Pills with Dropdown

Tabs with Dropdown

Toggleable Tabs



HOME

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

Toggleable Pills



HOME

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

Basic Navbar Example

A navigation bar is a navigation header that is placed at the top of the page.

The navbar-expand-xxl|xl|lg|md|sm class determines when the navbar should stack vertically (on xxlarge, extra large, large, medium or small screens).

Vertical Navbar Example

A navigation bar is a navigation header that is placed at the top of the page.

Centered Navbar

Use the .justify-content-center class to center the navigation bar.

In this example, the navbar will be centered on medium, large and extra large screens. On small screens it will be displayed vertically and left-aligned (because of the .navbar-expand-sm class).

Colored Navbar

Use any of the .bg-color classes to add a background color to the navbar.

Tip: Add a white text color to all links in the navbar with the .navbar-dark class, or use the .navbar-light class to add a black text color.

Brand / Logo

The .navbar-brand class is used to highlight the brand/logo/project name of your page.

Brand / Logo

When using the .navbar-brand class with images, Bootstrap 5 will automatically style the image to fit the navbar.

Navbar Text

Use the .navbar-text class to vertical align any elements inside the navbar that are not links (ensures proper padding).

Collapsible Navbar

In this example, the navigation bar is hidden on small screens and replaced by a button in the top right corner (try to re-size this window).

Only when the button is clicked, the navigation bar will be displayed.

Tip: You can also remove the .navbar-expand-md class to ALWAYS hide navbar links and display the toggler button.

Navbar With Dropdown

This example adds a dropdown menu in the navbar.

Navbar Forms

You can also include forms inside the navigation bar.


Sticky Navbar

A sticky navigation bar stays fixed at the top of the page when you scroll past it.

Scroll this page to see the effect. Note: sticky-top does not work in IE11 and earlier.


Some example text. Some example text. Some example text. Some example text. Some example text.

Some example text. Some example text. Some example text. Some example text. Some example text.

Some example text. Some example text. Some example text. Some example text. Some example text.

Some example text. Some example text. Some example text. Some example text. Some example text.

Carousel Example

The example above shows how to create a basic carousel with indicators and controls.

Carousel Example

The example above shows how to create a basic carousel with indicators and controls.

Modal Example

Click on the button to open the modal.

Fading Modal Example

Click on the button to open the modal.

Small Modal Example

Click on the button to open the modal.

Large Modal Example

Click on the button to open the modal.

Extra Large Modal Example

Click on the button to open the modal.

Fullscreen Modal Example

Click on the button to open the fullscreen modal.

Modal Scroll Example

Click on the button to open the modal.

Tooltip Example

Tooltip Positioning

The data-bs-placement attribute specifies the tooltip position.

Top Bottom Left Right

Popover Example

Popover Positioning

Click on the links to see the popover in action:

Top Bottom Left Right

Dismissible Popover

Click me

Hoverable Popover

Hover over me

Toast Example

A toast is like an alert box that is only shown for a couple of seconds when something happens (i.e. when a user clicks on a button, submits a form, etc.).

In this example, we use the .show class to always show the toast by default. You can close it by clicking on the close (x) icon inside the toast header.

Toast Header

Some text inside the toast body

Toast Example

In this example, we use a button to show the toast message.

Toast Header

Some text inside the toast body

Section 1

Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!

Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!

Section 2

Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!

Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!

Section 3

Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!

Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!

Heading

Some text lorem ipsum.

Some text lorem ipsum.

Some text lorem ipsum.

Offcanvas Sidebar

Offcanvas is similar to modals, except that it is often used as a sidebar.

Heading

Some text lorem ipsum.

Some text lorem ipsum.

Some text lorem ipsum.

Right Offcanvas

The .offcanvas-end class positions the offcanvas to the right of the page.

Borders

Use the border classes to add or remove borders from an element:


Borders

Round the corner of an element with the rounded classes:


Border Width

Use .border-1 to .border-5 to change the width of the border:

Borders

Use a contextual border color to add a color to the border:

Float

Float an element to the right with the .float-end class or to the left with .float-start, and clear floats with the .clearfix class.

Float left Float right

Responsive Floats

Float an element to the left or to the right depending on screen width, with the responsive float classes .float-*-left|right (where * is sm, md, lg, xl or xxl).

Resize the browser window to see the effect.

Float right on small screens or wider

Float right on medium screens or wider

Float right on large screens or wider

Float right on extra large screens or wider

Float right on XXL screens or wider

Float none

Horizontal Centering

Center an element with the .mx-auto class:

Centered

Width Utilities

Set the width of an element with the w-* classes:

Width 25%
Width 50%
Width 75%
Width 100%
Auto Width
Max Width 100%

Height Utilities

Set the height of an element with the h-* classes:

Height 25%
Height 50%
Height 75%
Height 100%
Auto Height

Spacing Utilities

Set the spacing of an element with the {property}{sides}-{breakpoint}-{size} classes. Omit breakpoint if you want the padding or margin to work on all screen sizes.

I only have a top padding (1.5rem)
I have a padding on all sides (3rem)
I have a margin on all sides (3rem) and a bottom padding (3rem)

Shadows

Use the shadow- classes to to add shadows to an element:

No shadow
Small shadow
Default shadow
Large shadow

Vertical Align

Change the alignment of elements with the align classes (only works on inline, inline-block, inline-table and table cell elements):

baseline top middle bottom text-top text-bottom

Aspect Ratio

Create a responsive video and scale it nicely to the parent element.

Aspect ratio 1:1


Aspect ratio 4:3


Aspect ratio 16:9


Aspect ratio 21:9

Visibility

Use the .visible or .invisible classes to control the visibility of elements. Note: These classes do not change the CSS display value. They only add visibility:visible or visibility:hidden to an element:

I am visible

Close Icon

Use the .close class to style a close icon. This is often used for alerts and modals. Note that we use the times; symbol to create the actual icon (a better looking "x"). Also note that it is right-aligned by default:

Screen readers

Use the .sr-only class to hide an element on all devices, except screen readers:

I will be hidden on all screens except for screen readers.

Contextual Colors

Use the contextual classes to provide "meaning through colors":

This text is muted.

This text is important.

This text indicates success.

This text represents some information.

This text represents a warning.

This text represents danger.

Secondary text.

This text is dark grey.

Default body color (often black).

This text is light grey (on white background).

This text is white (on white background).

Contextual Link Colors

Muted link. Primary link. Success link. Info link. Warning link. Danger link. Secondary link. Dark grey link. Body/black link. Light grey link.

Opacity Text Colors

Add 50% opacity for black or white text with the .text-black-50 or .text-white-50 classes:

Black text with 50% opacity on white background

White text with 50% opacity on black background

Contextual Backgrounds

Use the contextual background classes to provide "meaning through colors".

Background Color with Contrasting Text Color

This text is important.

This text indicates success.

This text represents some information.

This text represents a warning.

This text represents danger.

Secondary background color.

Dark grey background color.

Light grey background color.

My Page

Lorem ipsum text.

A card.

Some buttons:

My Page

Lorem ipsum text.

A card.

Some buttons:

Dark Mode Table

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com

Dark Mode Dropdown

Click on the dropdown menu to see the effect.

Flex

To create a flexbox container and transform direct children into flex items, use the d-flex class:

Flex item 1
Flex item 2
Flex item 3

Inline Flex

To create an inline flexbox container, use the d-inline-flex class:

Flex item 1
Flex item 2
Flex item 3

Horizontal Direction

Use .flex-row to make the flex items appear side by side (default):

Flex item 1
Flex item 2
Flex item 3

Use .flex-row-reverse to right-align the direction:

Flex item 1
Flex item 2
Flex item 3

Vertical Direction

Use .flex-column to display the flex items vertically (on top of each other):

Flex item 1
Flex item 2
Flex item 3

Use .flex-column-reverse to reverse the vertical direction:

Flex item 1
Flex item 2
Flex item 3

Justify content

Use the .justify-content-* classes to change the alignment of flex items. Choose from start (default), end, center, between or around:

Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3

Fill / Equal Widths

Use .flex-fill on flex items to force them into equal widths:

Flex item 1
Flex item 2
Flex item 3

Example without .flex-fill:

Flex item 1
Flex item 2
Flex item 3

Order

Change the visual order of a specific flex item(s) with the .order classes. Valid classes are from 0 to 5:

Flex item 1
Flex item 2
Flex item 3

Auto Margins

Easily add auto margins to flex items with .mr-auto (push items to the right), or by using .ml-auto (push items to the left):

Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3

Wrap

Control how flex items wrap in a flex container with .flex-nowrap (default), .flex-wrap or .flex-wrap-reverse.

.flex-wrap:

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5
Flex item 6
Flex item 7
Flex item 8
Flex item 9
Flex item 10
Flex item 11
Flex item 12
Flex item 13
Flex item 14
Flex item 15
Flex item 16
Flex item 17
Flex item 18
Flex item 19
Flex item 20
Flex item 21
Flex item 22
Flex item 23
Flex item 24
Flex item 25

.flex-wrap-reverse:

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5
Flex item 6
Flex item 7
Flex item 8
Flex item 9
Flex item 10
Flex item 11
Flex item 12
Flex item 13
Flex item 14
Flex item 15
Flex item 16
Flex item 17
Flex item 18
Flex item 19
Flex item 20
Flex item 21
Flex item 22
Flex item 23
Flex item 24
Flex item 25

.flex-nowrap:

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5
Flex item 6
Flex item 7
Flex item 8
Flex item 9
Flex item 10
Flex item 11
Flex item 12
Flex item 13
Flex item 14
Flex item 15
Flex item 16
Flex item 17
Flex item 18
Flex item 19
Flex item 20
Flex item 21
Flex item 22
Flex item 23
Flex item 24
Flex item 25
Flex item 26
Flex item 27
Flex item 28
Flex item 29
Flex item 30
Flex item 31
Flex item 32
Flex item 33
Flex item 34
Flex item 35

Align Content

Control the vertical alignment of gathered flex items with the .align-content-* classes.

Note: This example does not look good on a small devices. Also note that these classes have no effect on single rows of flex items.

.align-content-start (default):

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5
Flex item 6
Flex item 7
Flex item 8
Flex item 9
Flex item 10
Flex item 11
Flex item 12
Flex item 13
Flex item 14
Flex item 15
Flex item 16
Flex item 17
Flex item 18
Flex item 19
Flex item 20
Flex item 21
Flex item 22
Flex item 23
Flex item 24
Flex item 25

.align-content-end:

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5
Flex item 6
Flex item 7
Flex item 8
Flex item 9
Flex item 10
Flex item 11
Flex item 12
Flex item 13
Flex item 14
Flex item 15
Flex item 16
Flex item 17
Flex item 18
Flex item 19
Flex item 20
Flex item 21
Flex item 22
Flex item 23
Flex item 24
Flex item 25

.align-content-center:

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5
Flex item 6
Flex item 7
Flex item 8
Flex item 9
Flex item 10
Flex item 11
Flex item 12
Flex item 13
Flex item 14
Flex item 15
Flex item 16
Flex item 17
Flex item 18
Flex item 19
Flex item 20
Flex item 21
Flex item 22
Flex item 23
Flex item 24
Flex item 25

.align-content-around:

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5
Flex item 6
Flex item 7
Flex item 8
Flex item 9
Flex item 10
Flex item 11
Flex item 12
Flex item 13
Flex item 14
Flex item 15
Flex item 16
Flex item 17
Flex item 18
Flex item 19
Flex item 20
Flex item 21
Flex item 22
Flex item 23
Flex item 24
Flex item 25

.align-content-stretch:

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5
Flex item 6
Flex item 7
Flex item 8
Flex item 9
Flex item 10
Flex item 11
Flex item 12
Flex item 13
Flex item 14
Flex item 15
Flex item 16
Flex item 17
Flex item 18
Flex item 19
Flex item 20
Flex item 21
Flex item 22
Flex item 23
Flex item 24
Flex item 25

Align Items

Control the vertical alignment of single rows of flex items with the .align-items-* classes.

.align-items-start:

Flex item 1
Flex item 2
Flex item 3

.align-items-end:

Flex item 1
Flex item 2
Flex item 3

.align-items-center:

Flex item 1
Flex item 2
Flex item 3

.align-items-baseline:

Flex item 1
Flex item 2
Flex item 3

.align-items-stretch (default):

Flex item 1
Flex item 2
Flex item 3

Align Self

Control the vertical alignment of a specific flex item with the .align-self-* classes.

.align-self-start:

Flex item 1
Flex item 2
Flex item 3

.align-self-end:

Flex item 1
Flex item 2
Flex item 3

.align-self-center:

Flex item 1
Flex item 2
Flex item 3

.align-self-baseline:

Flex item 1
Flex item 2
Flex item 3

.align-self-stretch (default):

Flex item 1
Flex item 2
Flex item 3

Stacked form

Textarea

Use the .form-control class to style textareas as well:

Inline Forms

If you want your form elements to appear side by side, use .row and .col:

Form Control Size

You can change the size of .form-control inputs with .form-control-lg or .form-control-sm:

Disabled and Readonly

Use the disabled and/or readonly attributes to disable the input field:

Plaintext

Use the .form-control-plaintext class to style an input field without borders, but with correct marigins and padding:

Color Picker

To style an input with type="color" properly, use the .form-control-color class:

Select Menu

To style a select menu in Bootstrap 5, add the .form-select class to the select element:


Select Menu Size

Use the .form-select-lg or .form-select-sm class to change the size of the select menu:

Select Menu Size

Use the disabled attribute to disable the select menu:

Data List

Checkboxes

To style a checkbox, use a container element with a .form-check class, and add .form-check-label to labels, and .form-check-input to the input with type="checkbox".

The form below contains three checkboxes. The first option is checked by default, and the last option is disabled:

Radio buttons

The form below contains three radio buttons. The first option is checked by default, and the last option is disabled:

Toggle Switch

Try to submit the form with and without toggling the switch.

Custom Range

To create a custom range menu, add the .form-range class to the input element with type="range":

Steps in a Range

By default, the interval between the range numbers is 1. You can change it by using the step attribute:

Min and Max Range

Use the min and/or max attribute to specify the minimum/maximum value of a range:

Input Group

The .input-group class is a container to enhance an input by adding an icon, text or a button in front or behind the input field as a "help text".

Use the .input-group-text class to style the specified help text.

@
@example.com

Input Group Size

Use the .input-group-sm class for small input groups and .input-group-lg for large inputs groups:

Small
Default
Large

Multiple Inputs and Helpers

Add multiple inputs or addons:

Person
One Two Three

Input Group with Checkboxes and Radios

You can also use checkboxes or radio buttons instead of text:

Input Group Buttons

Input Groups with Dropdown Button

Add a dropdown button in the input group. Note that you don't need the .dropdown wrapper, as you normally would.

Floating Labels - Inputs

Click inside the input field to see the floating label effect:

Floating Labels - Textarea

Click inside the textarea to see the floating label effect:

Floating Labels - Select

You can also use "floating-labels" on select menus. However, they will not float/get animated. The label will always appear in the top left corner, inside the select menu:

Form Validation

Try to submit the form.

Valid.
Please fill out this field.
Valid.
Please fill out this field.
Valid.
Check this checkbox to continue.

Basic Grid Structure

Resize the browser window to see the effect.

The first, second and third row will automatically stack on top of each other when the screen is less than 576px wide.

50%
50%

33.33%
33.33%
33.33%

25%
25%
25%
25%

25%
25%
25%
25%

Grid Example

This example demonstrates a 50%/50% split on small, medium, large, xlarge and xxlarge devices. On extra small devices, it will stack (100% width).

Resize the browser window to see the effect.

Lorem ipsum...
Sed ut perspiciatis...

Auto Layout Columns

In Bootstrap 5, there is an easy way to create equal width columns: just use the .col-size class on a specified number of col elements. Bootstrap will recognize how many columns there are, and each column will get the same width.

Two columns: 50% width on all screens, except for extra small (100% width on screens less than 576px wide)

1 of 2
2 of 2

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

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

Extra Small Grid (Auto Layout)

The following example will result in a 25%/75% split on all devices.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

Extra Small Grid

The following example will result in a 33.3%/66.6% split on all devices.

Resize the browser window to see the effect.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

This example will result in a 50%/50% split on all devices.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

Auto Layout Columns

In Bootstrap 5, there is an easy way to create equal width columns for all devices: just use the .col class on a specified number of col elements. Bootstrap will recognize how many columns there are, and each column will get the same width.

1 of 2
2 of 2

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

Small Grid

The following example will result in a 25%/75% split on small, medium, large, xlarge and xxlarge devices (576px and above). On extra small devices, it will stack (100% width).

Resize the browser window to see the effect.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

Medium Grid

The following example will result in a 25%/75% split on small devices and a 50%/50% split on medium (and large, xlarge, xxlarge) devices. On extra small devices, it will automatically stack (100%).

Resize the browser window to see the effect.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

Large Grid

The following example will result in a 25%/75% split on small devices, a 50%/50% split on medium devices, and a 33%/66% split on large, xlarge and xxlarge devices. On extra small devices, it will automatically stack (100%).

Resize the browser window to see the effect.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

Responsive Auto Layout Columns

In Bootstrap 5, there is an easy way to create equal width columns: just use the .col-lg class on a specified number of col elements. Bootstrap will recognize how many columns there are, and each column will get the same width.

If the screen size is less than 992px, the columns will stack horizontally.

1 of 2
2 of 2

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

XLarge Grid

The following example will result in a 25%/75% split on small devices, a 50%/50% split on medium devices, a 33%/66% split on large devices and a 20%/80% on xlarge and xxlarge devices. On extra small devices, it will automatically stack (100%).

Resize the browser window to see the effect.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

XLarge Grid

The following example will result in a 50%/50% split on xlarge devices (1200px and above). On large, medium, small and extra small devices, it will automatically stack (100%).

Resize the browser window to see the effect.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

Responsive Auto Layout Columns

In Bootstrap 5, there is an easy way to create equal width columns: just use the .col-xl class on a specified number of col elements. Bootstrap will recognize how many columns there are, and each column will get the same width.

If the screen size is less than 1200px, the columns will stack horizontally.

1 of 2
2 of 2

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

XXL Grid

The following example will result in a 50%/50% split on medium, large and extra large devices, and a 25%/75% split on XXL devices. On small and extra small devices, it will automatically stack (100%):

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

XXL Grid

The following example will result in a 50%/50% split on XXL devices (1400px and above). On extra large, large, medium, small and extra small devices, it will automatically stack (100%).

Resize the browser window to see the effect.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.

Responsive Auto Layout Columns

In Bootstrap 5, there is an easy way to create equal width columns: just use the .col-xxl class on a specified number of col elements. Bootstrap will recognize how many columns there are, and each column will get the same width.

If the screen size is less than 1400px, the columns will stack horizontally.

1 of 2
2 of 2

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