div
and section
elements have my-3
and border-3
applied to them..progress-bar-striped
to child.progress-bar-animated
to child..spinner-border
to container..text-primary
).spinner-grow
to container..pagination
to <ul>
and
.page-item
to <li>
and .page-link
to <a>
..active
to <li>
..disabled
to <li>
..pagination-lg|sm
to <ul>
..justify-content
..breadcrumb
and .breadcrumb-item
with child prop.<ul>
with .list-group
and <li>
with .list-group-item
..active
or .disabled
.<div>
with <a>
..list-group-item-action
..list-group-flush
on container to remove most borders..list-group-numbered
on container..list-group-horizontal
on container..list-group-item-*
to child.<span class="badge bg-* rounded-pill>
to child..d-flex .justify-content-between
.align-items-center
to <li>
to space correctly..card
on the container and .card-header .card-body
.card-footer
on <div>
with content in child prop..bg-*
on container..card-title
on header tag inside of body..card-text
on <p>
inside of body..card-link
inside <a>
inside of body..card-img-top|bottom
to an <img>
.<div>
as sibling of <img>
with .card-img-overlay
..dropdown
to container.<button>
with .dropdown-toggle
and attribute of
data-bs-toggle="dropdown"
..dropdown-menu
as <ul>
and .dropdown-item
to each element.<hr class="dropdown-divider">
inside a <li>
to create a divider..dropdown-header
to a header inside of a
<li>
to create a header..dropend|dropstart
to container..dropdown-menu-end
to element with .dropdown-menu
..dropdown
with .dropup
.<span>
with .dropdown-item-text
to <li>
.data-bs-target
to ID of your collapsible element and
data-bs-toggle="collapse"
attribute. Then add .collapse
to your collapsible element. Use .show
to show content initially.
.nav
to <ul>
, .nav-item
to
<li>
and .nav-link
to links..justify-content-center|end
to <ul>
..flex-column
to <ul>
..nav-tabs
to <ul>
..active
.nav-pills
to <ul>
..nav-justified
to <ul>
.data-bs-toggle="tab"
attribute to each link. Add .tab-pane
with
a unique ID for every tab and wrap them inside a <div>
element with
.tab-content
..fade
on .tab-pane
to fade in and out when clicked.data-bs-toggle="pill"
attribute to each link. Add .tab-pane
with
a unique ID for every tab and wrap them inside a <div>
element with
.tab-content
..fade
on .tab-pane
to fade in and out when clicked..navbar
and .navbar-expand-xxl|xl|lg|md|sm
to
<nav>
.bg-*
here!.navbar-nav
to <ul>
.<li>
elements with .nav-item
followed
by an <a>
with .nav-link
..navbar-expand-*
..justify-content-center
to <nav>
.<div>
with .container-fluid
around the
<ul>
. .justify-content-*
will not work in those
cases..justify-content-around
to <ul>
and
add .w-100
.nav
, as well as
.navbar-dark|light
to change text color..navbar-brand
in an <a>
child of a div
right below the <nav>
..navbar-text
when adding text to navbar to ensure proper styling.text-decoration-none
on
parent to remove underline..navbar-toggler , data-bs-toggle="collapse" and
data-bs-target="#ID"
. Use a <span> .navbar-toggler-icon
for icon.<div> .collapse navbar-collapse
with an ID that matches the target of the button..me-auto
on <ul>
to right justify Search box/button..fixed-top|bottom
or .sticky-top
to <nav>
.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.
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.
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.
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.
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.
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.
<div>
with and ID, .carousel .slide
and
attribute data-bs-ride="carousel"
.data-bs-ride
starts the
animation on page load.<div>
with .carousel-indicators
.
Add a button for each slide with data-bs-target="#ID" data-bs-slide-to="0"
.
Don't forget to add .active
to beginning slide.<div>
with .carousel-inner
.
Then add <div>
with .carousel-item
for each image. Don't
forget .active
and to use .d-block .w-100
on <img>
.
NOTE: Use style object-fit: contain|cover
and object-position
in addition to setting image width/height to 100% to correct image. Use height xx%vh on
carousel-item
to change size of carousel.<button>
with .carousel-control-prev|next
data-bs-target="#ID" data-bs-slide="prev|next"
. Add <span>
with
.carousel-control-prev|next-icon
as button text.<div>
as sibling to <img>
with .carousel-caption
and add
<h3>
and/or <p>
.<button>
with data-bs-toggle="modal"
and data-bs-target="#ID"
to open modal.<div>
's':
.modal
and ID
.modal-dialog
.modal-content
<div>
with .modal-header
. Follow with
<h4>
with .modal-title
for Modal Heading. Finally,
<button>
with .btn-close data-bs-dismiss="modal"
.<div>
with .modal-body
which contains
the main text.<div>
with .modal-footer
. This
contains a <button>
with data-bs-dismiss="modal"
..fade
to main container..modal-sm|lg|xl
to .modal-dialog
..modal-fullscreen
to .modal-dialogue
..modal-fullscreen-*-down
to .modal-dialogue
, where
* indicates screensize below the modal should be fullsize..modal-dialog-centered
to .modal-dialog
..modal-dialog-scrollable
to .modal-dialog
.data-bs-toggle="tooltip"
attribute to an element, then
use title
attribute to specify tooltip text.data-bs-placement="top|bottom|left|right"
to change.data-bs-toggle="popover"
atrribute to an element. Use title
to specify header text and data-bs-content
for body text.data-bs-placement="top|bottom|left|right"
to change.data-bs-trigger="focus"
.data-bs-trigger="hover"
..show
to always show toast.<div>
with
.toast
. Add a button to close the toast using data-bs-dismiss="toast"
.<div>
with .toast-header
.<div>
with .toast-body
.I hope you have a wonderful and prosperous New Year!
data-bs-spy="scroll", data-bs-target=".navbar", data-bs-offset="50"
to the body
element..offcanvas .offcanvas-start|end|top|bottom
and an ID.
.offcanvas-header
which contains an h1
with .offcanvas-title
and a button
to close the offcanvas.
.offcanvas-body
that contains your main content (links/buttons).
button
outside the offcanva to open it with data-bs-toggle="offcanvas",
data-bs-target="#ID"
.
type="button"
. Otherwise,
the position will reset when the Offcanvas is closed!.offcanvas-sm|md|lg|xl|xxl
to main container..d-md-none
..text-bg-dark
to main container to create a dark offcanvas menu..btn-close-whie
to your closing button..border
adds a standard grey border.
.border-top|bottom|start|end
puts a border only on that side.
.border-*-0
removes that border segment.
.border-*
where * is 1-5 to increase border width.
.border-*
, where * is a contextual class, to add color.
.rounded-*
to add border-radius. * can be between 0 and 5.
.rounded-circle
for a circle.
.rounded-pill
for a large border-radius.
.float-start|end
to justify text..clearfix
on container to make floats stay in their parent container..float-sm|md|lg|xl|xxl|none-start|end
..mx-auto
to center a block..w-25|50|75|100|auto
or .mw-100
to set the width..h-25|50|75|100|auto
or .mh-100
to set the height.{property}{sides}-{breakpoint}-{size}
.m
).p
).shadow-none|sm|blank|lg
.align-baseline|top|middle|bottom|text-top|text-bottom
..ratio .ratio-1x1|4x3|16x9|21x9
to container..invisible|.visible
to control an elements visibility..visually-hidden
to hide an element on all devices except screen readers..btn-close
to style a close icon - for alerts and modals mostly.data-bs-theme="dark"
to <html>
or a specific component..d-flex
to a container..d-inline-flex
..flex-row-reverse
..flex-row
..flex-column
or
.flex-column-reverse
..justify-content-start|end|center|between|around
to change
the alignment of flex items on the main axis..flex-fill
on each flex-item..flex-grow-1
on a single flex-item to make it take up the
rest of the space..flex-shrink-1
to make a flex item shrink if necessary..order-0|1|2|3|4|5
to change the order. The lower number is shown
first..ms-auto
to right justify flex items, and .me.auto
to left justify flex items. These classes get applied to the flex items..ms-auto
applied to 2nd flex item..flex-wrap
,
flex-wrap-reverse
or flex-nowrap
(default)..align-content-
start|end|center|between|around|stretch
..align-items-*
for
single rows of flex items. Valid classes are start|end|center|baseline|stretch
.align-self-start|end|center|baseline|stretch
to chance the vertical
alignment of a single flex item..form-control
to <input>
and
<textarea>
..form-label
to each label element..row
and .col
to make form elements appear side by side.form-control-sm|lg
to .form-control
.disabled
and readonly
in addition
to .form-control
..form-control-plaintext
on fields to remove borders but keep
margins and padding.type="color"
, .form-control .form-control-color
and value="#CCCCCC"
to create a color picker..form-select
to the <select>
element.multiple
attribute to
allow several items to be picked..form-select-sm|lg
to change the select menu size.disabled
to the select menu.<input>
element..form-check
..form-check-label
..form-check-input
.checked
to have an
option checked by default.disabled
to have an
option disabled.radio
..form-switch
on the main wrapper (.form-check
).form-range
to the input with type="range"
.step="#"
to input.min
and max
attributes..input-group
on a wrapper and .input-group-text
on
a <span>
..input-group-sm|lg
to .input-group
to change the
size of an input group.<div>
with .input-group-text
followed by your <input>
.<label>
element must come
after the <input>
element and the placeholder
attribute
is required even though it is not shown..was-validated
(before) or .needs-validation
(after) to the
<form>
element depending on if you want feedback to
occur before or after form submission..valid-feedback
or .invalid-feedback
in a <div>
to tell the user what's missing or needs to be done
before submission..col-|sm|md|lg|xl|xxl
.<div>
's to render the correct
percentages.<div>
's to render the correct
percentages.<div>
's to render the correct
percentages.<div>
's to render the correct
percentages.<div>
's to render the correct
percentages..row-cols-*
to .row
..g-1|2|3|4|5
to the row..g-4
.