Letzte Änderung: 06. Juli 2021


Bootstrap 5 Tipps

CSS Order


HTML Block and Inline Elements


Centering methods in Bootstrap 5


Flexbox

display:flex

(d-flex) is used by

default

on grid (col) columns.

justify-content-center

on row to center grid columns

inside row div

. Example: <div class="row justify-content-center"></div>

mx-auto

on col can be used to center

grid column div

. Example: <div class="col mx-auto"></div>

mx-auto

for centering

display:block elements with a defined width, (%, vw, px, etc..)

. Example: <div class="mx-auto w-50">Text</div>

text-center

for center

display:inline and display:block elements inside div

. Example: <div class="text-center"><span>Text</span></div> and <div class="text-center"><header>Text</header></div>

Text decoration


Reset a text or link’s color with class="text-reset"

Blockquote: class="blockquote"

<p class="fw-bold">Bold text.</p>

<p class="fw-bolder">Bolder weight text (relative to the parent element).</p>

<p class="fw-normal">Normal weight text.</p>

<p class="fw-light">Light weight text.</p>

<p class="fw-lighter">Lighter weight text (relative to the parent element).</p>

<p class="fst-italic">Italic text.</p>

<p class="fst-normal">Text with normal font style</p>

<p class="text-decoration-underline">This text has a line underneath it.</p>

<p class="text-decoration-line-through">This text has a line going through it.</p>

<a href="#" class="text-decoration-none">This link has its text decoration removed</a>

Font size


<p class="font-monospace">This is in monospace</p>

<p class="lead">This is a lead paragraph. It stands out from regular paragraphs.</p>

<p class="fs-6">Text</p>

<p class="fs-5">Text</p>

<p class="fs-4">Text</p>

<p class="fs-3">Text</p>

<p class="fs-2">Text</p>

<p class="fs-1">Text</p>


<p class="h6">h6 Bootstrap heading</p>

<p class="h5">h5 Bootstrap heading</p>

<p class="h4">h4 Bootstrap heading</p>

<p class="h3">h3 Bootstrap heading</p>

<p class="h2">h2 Bootstrap heading</p>

<p class="h1">h1 Bootstrap heading</p>


<h1 class="display-6">Display 6</h1>

<h1 class="display-5">Display 5</h1>

<h1 class="display-4">Display 4</h1>

<h1 class="display-3">Display 3</h1>

<h1 class="display-2">Display 2</h1>

<h1 class="display-1">Display 1</h1>