> 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-clip

APISummary
## Introduction

The `background-clip` CSS property sets whether an element's background extends underneath its border box, padding box, or content box.

## Examples

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

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

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

const BackgroundClip = () => {
  const scrollViewStyle = {
    flexDirection: "column" as const,
    height: "2500px",
  };

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

  return (
    <scroll-view className="root" scroll-orientation="vertical" style={scrollViewStyle}>
      <view className="fixed_area" style={fixedAreaStyle}>
        <text className="shared border-box"></text>
        <text className="shared padding-box"></text>
        <text className="shared content-box"></text>
        <text className="shared border-box radius"></text>
        <text className="shared padding-box radius"></text>
        <text className="shared content-box radius"></text>
        <text className="shared border-box radius2"></text>
        <text className="shared padding-box radius2"></text>
        <text className="shared content-box radius2"></text>
        <text className="shared border-area"></text>
        <text className="shared border-area radius"></text>
        <text className="shared border-area radius2"></text>
        <view className="container"></view>
        <view className="border-area-container"></view>
      </view>
    </scroll-view>
  );
};

root.render(<BackgroundClip />);

```

v0.11.0



## Syntax

```css
background-clip: border-box;
background-clip: padding-box;
background-clip: content-box;
background-clip: border-area;

// multiple clip
background-clip: border-box, content-box, padding-box, border-area;
```

### Values

- **`border-box`** 

  The background extends to the outside edge of the border (but underneath the border in z-ordering).

- **`padding-box`** 

  The background extends to the outside edge of the padding. No background is drawn beneath the border

- **`content-box`**
  The background is painted within (clipped to) the content box.

- **`border-area`**
  The background is painted within (clipped to) the area painted by the border, taking [`border-width`](/next/api/css/properties/border-width.md) into account.

## Notes

If the length of `background-clip` is less than [`background-image`](/next/api/css/properties/background-image.md), the first clip value will effect on all remained [`background-image`](/next/api/css/properties/background-image.md).

## Formal definition

| Initial value | border-box |
| Applies to | all elements |
| Inherited | no |
| Animatable | no |


## Formal Syntax

```
<background-clip> = <box> | border-area

where

<box> = border-box | padding-box | content-box

```

## Differences from the Web

- Only support `border-box`、`padding-box`、`content-box` 、 `border-area` 


- `background-clip:text` is not support, and if want show text with gradient color, just set `color: <gradient>`.

- `border-area` doesn't take `border-style` into account.

## Compatibility

**Compatibility Table**

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

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

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| background-clip | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| box | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| border-area | Yes (3.7) | Yes (3.7) | Yes (3.7) | Yes (3.7) | Yes (3.7) | Unknown |

**`background-clip`**

**Specifications:**

**`box`**

<code>&lt;box&gt;</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/123-background-clip.json)

**`border-area`**

<code>border-area</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/123-background-clip.json)

- **Web — Compatibility unknown:** Passed through to the browser. Support for border-area depends on the browser.

