Javatpoint Logo
Javatpoint Logo

Bootstrap 5 Colors

Bootstrap 5 provides multiple color classes for the web component. Bootstrap 5 colors convey a message about the function, element, and text. It provides a class to display text and background in the required color. For example, the red color gives the ":danger" class in the tag.

Bootstrap 5 Text color

Bootstrap 5 provides a color class for text to convey the particular meaning of the sentence. Bootstrap 5 uses color classes to display different colors are called contextual classes.

Syntax

The following table shows us text color and its class in detail.

Bootstrap 5 text color Description
"text-primary" This class shows content is important and shows in blue color.
"text-secondary" This class shows content is secondary and shown in grey color.
"text-muted" This class shows content is muted and shown in light grey color.
"text-light" This class shows light grey color content (visible on dark background).
"text-dark" This class shows in dark grey color content.
"text-info" This class shows content that is informative and shown in sky blue color.
"text-warning" This class conveys warning text and is shown in yellow color.
"text-success" This class conveys success text and shows it in green color.
"text-danger" This class conveys danger or alert text and is shown in red color.
"text-body" This class shows in dark grey color content.
"text-white" This class shows in white color content (visible on dark background).

Example

The following example shows us text color and its class. Here, we can see all the bootstrap 5 color classes for the content.

Output

The output shows text or content color in the below image.

Bootstrap 5 Colors

Bootstrap 5 Background color

Bootstrap 5 provides a color class to the background of the element. These colors convey a particular meaning of the function or features. Bootstrap 5 uses background color classes to display different colors are called contextual classes.

Syntax

The following table shows us the background color and its class in detail.

Bootstrap 5 background color Description
"bg-primary" This class shows element is important and shows the background in blue color.
"bg-secondary" This class shows element is secondary and shows a background in grey color.
"bg-muted" This class shows element is muted and shown in light grey color.
"bg-light" This class shows a background in light grey color (visible on dark background).
"bg-dark" This class shows a background in dark grey color.
"bg-info" This class shows content that is informative and shown in sky blue color.
"bg-warning" This class conveys warning background of the function and shows it in yellow color.
"bg-success" This class conveys success background of the function and shows it in green color.
"bg-danger" This class conveys danger or alert text and is shown in red color.
"bg-body" This class shows in dark grey color content.
"bg-white" This class shows in white color content (visible on dark background).

Example

The following example shows us background color and its class. Here, we can see all the bootstrap 5 color classes for the background of the element.

Output

The output shows the background color of the element in the below image.

Bootstrap 5 Colors

Bootstrap 5 colors example

The following example uses bootstrap 5 background color in the web page. Here, we can use navigation bar, contrainer-fluid, and grid system in web page. This element displays with required background color and color text.

Output

The output shows the content and background color of the web page in the below image.

Bootstrap 5 Colors

Conclusion

Bootstrap 5 colors create web applications that are attractive, eye-catchy, and understandable. This class used to style each element and component of the web page. Some bootstrap 5 color classes provide meaning to the text or component.


Next TopicBootstrap 5 table





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA