How to change text color in CSS
Changing the color of text is a fundamental aspect of web design. CSS (Cascading Style Sheets) and Bootstrap offer a variety of ways to change text color. In this article, we'll show you how to change text color using CSS and Bootstrap with easy-to-follow examples.
Change Text Color Using Bootstrap
Bootstrap, a popular CSS framework, also provides utility classes for text colors.
Easily set the text color by using .text-*
color classes
.text-primary
.text-secondary
.text-success
.text-danger
.text-warning
.text-info
.text-light
.text-dark
.text-body
.text-muted
.text-white
.text-black
.text-white-50
.text-black-50
Change Text Color Using Inline CSS
One of the simplest ways to change text color is by using inline CSS.
The style="color: red;"
attribute within the <p>
tag sets the text color to red.
This text is red.