> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# background-color

APISummary
## Introduction

The `background-color` CSS property sets the background color of an element.

## Examples

**This is an example below: css-api**

**Entry:** `src/background-color`
**Bundle:** `dist/background-color.lynx.bundle`

```tsx
import { root } from "@lynx-js/react";
import "./index.scss";

const BackgroundColor = () => {
  const fixedAreaStyle = {
    width: "100%",
    height: "100%",
    flexDirection: "column" as const,
  };

  return (
    <scroll-view className="root" scroll-orientation="vertical">
      <view className="fixed_area" style={fixedAreaStyle}>
        <text className="container text1"></text>
        <text className="container text2"></text>
        <text className="container text3"></text>
        <text className="container text4"></text>
        <text className="container text5"></text>
        <text className="container text6"></text>
        <text className="container text7"></text>
        <text className="container text8"></text>
        <text className="container text9"></text>
      </view>
    </scroll-view>
  );
};

root.render(<BackgroundColor />);

```

v0.11.0



## Syntax

```css
/* Keyword values */
background-color: red;

/* Hexadecimal value */
background-color: #bbff00;

/* RGB value */
background-color: rgb(255, 255, 128);

/* HSLA value */
background-color: hsla(50, 33%, 25%, 0.75);
```

### Values

- [`<color>`](/next/api/css/data-type/color.md) 

  The uniform color of the background.

- Default value **transparent** 


## Formal definition

| Initial value | transparent |
| Applies to | all elements |
| Inherited | no |
| Animatable | yes |


## Formal Syntax

```
<bg-color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color>
```

## Differences from the Web

- Not support special keywords like `currentcolor`
- Not support global keywords like `inherit`、`initial`

## Compatibility

**Compatibility Table**

**Query:** `css.properties.background-color`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/7-background-color.json) · [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| background-color | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`background-color`**

**Specifications:**

