Bootstrap 5 Default Settings
Bootstrap 5 uses a default font-size
of 1rem (16px by default), and its line-height
is 1.5
In addition, all <p>
elements have margin-top:
0 and margin-bottom:
1rem (16px by default).
<h1> - <h6>
Bootstrap 5 styles HTML headings (<h1> to <h6>) with a bolder font-weight and a responsive font-size.
Example
h1 Bootstrap heading
h2 Bootstrap heading
h3 Bootstrap heading
h4 Bootstrap heading
h5 Bootstrap heading
h6 Bootstrap heading
Display Headings
You can also use .h1
to .h6
classes on other elements to make them behave as headings if you want:
Example
Display 1
Display 2
Display 3
Display 4
Display 5
Display 6
<small>
In Bootstrap 5 the HTML element (and the .small class) is used to create a smaller, secondary text in any heading:
Example
h1 heading secondary text
h2 heading secondary text
h3 heading secondary text
h4 heading secondary text
h5 heading secondary text
h6 heading secondary text
<mark>
Bootstrap 5 will style <mark>
and .mark
with a yellow background color and some padding: