Course Content
Bootstrap 5 Alerts
0/1
Bootstrap
About Lesson

Text Colors:

Applies a muted gray color to the text.

Example:

HTML
<p class="text-muted">This text is muted.</p>

Output:

Applies the primary color to the text.

Example:

HTML
<p class="text-primary">This text is primary.</p>

Output:

Applies a green color to indicate success.

Example:

HTML
<p class="text-success">This text indicates success.</p>

Output:

Applies a blue color to indicate information.

Example:

HTML
<p class="text-info">This text provides information.</p>

Output:

Applies a yellow color to indicate a warning.

Example:

HTML
<p class="text-warning">This text is a warning.</p>

Output:

Applies a red color to indicate danger or error.

Example:

HTML
<p class="text-danger">This text indicates danger.</p>

Output:

Applies a secondary color to the text.

Example:

HTML
<p class="text-secondary">This text is secondary.</p>

Output:

Applies white color to the text.

Example:

HTML
<p class="text-white bg-dark">This text is white on dark background.</p>

Output:

Applies a dark color to the text.

Example:

HTML
<p class="text-dark">This text is dark.</p>

Output:

Applies the default body color, often black.

Example:

HTML
<p class="text-body">This text has the default body color.</p>

Output:

Applies a light color to the text.

Example:

HTML
<p class="text-light bg-dark">This text is light on dark background.</p>

Output:

The classes for text colors are: .text-muted, .text-primary, .text-success, .text-info, .text-warning, .text-danger, .text-secondary, .text-white, .text-dark, .text-body (default body color/often black) and .text-light:

Example:

HTML
    <p class="text-muted">This text is muted.</p>
    <p class="text-primary">This text is primary.</p>
    <p class="text-success">This text indicates success.</p>
    <p class="text-info">This text provides information.</p>
    <p class="text-warning">This text is a warning.</p>
    <p class="text-danger">This text indicates danger.</p>
    <p class="text-secondary">This text is secondary.</p>
    <p class="text-white bg-dark">This text is white on dark background.</p>
    <p class="text-dark">This text is dark.</p>
    <p class="text-body">This text has the default body color.</p>
    <p class="text-light bg-dark">This text is light on dark background.</p>

Output: