> For the complete documentation index, see [llms.txt](https://codennerd.gitbook.io/cxcss/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codennerd.gitbook.io/cxcss/product-guides/backgrounds/bg-color.md).

# Backgrounds Color

The following classes control the background color of elements:

## `.bg-success`

Sets the background color to the success color value.

CSS equivalent: `background-color: successColor;`

Example usage:

```html
<div class="bg-success">
  <!-- Content with a success background color -->
</div>
```

In the example above, the background color of the element will be set to the success color.

***

## `.bg-danger`

Sets the background color to the danger color value.

CSS equivalent: `background-color: dangerColor;`

Example usage:

```html
<div class="bg-danger">
  <!-- Content with a danger background color -->
</div>
```

In the example above, the background color of the element will be set to the danger color.

***

## `.bg-warning`

Sets the background color to the warning color value.

CSS equivalent: `background-color: warningColor;`

Example usage:

```html
<div class="bg-warning">
  <!-- Content with a warning background color -->
</div>
```

In the example above, the background color of the element will be set to the warning color.

***

## `.bg-info`

Sets the background color to the info color value.

CSS equivalent: `background-color: infoColor;`

Example usage:

```html
<div class="bg-info">
  <!-- Content with an info background color -->
</div>
```

In the example above, the background color of the element will be set to the info color.

***

## `.bg-none`

Resets the background color to its initial value.

CSS equivalent: `background-color: initial;`

Example usage:

```html
<div class="bg-none">
  <!-- Content with no background color -->
</div>
```

In the example above, the background color of the element will be reset to its initial value.

***

## `.bg-${color}`

Sets the background color to a custom color value.

CSS equivalent: `background-color: colorValue;`

Example usage:

```html
<div class="bg-green">
  <!-- Content with a green background -->
</div>
```

In the example above, the background color of the element will be set to green. You can also use color codes like `#008000` or `rgb(0,128,0)` to set custom colors.

***

These utility classes provide a convenient way to apply predefined background colors or define your own custom background colors to elements in your web page.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://codennerd.gitbook.io/cxcss/product-guides/backgrounds/bg-color.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
