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

APISummary
## Introduction

The `background-repeat` CSS property sets how background images are repeated. A background image can be repeated along the horizontal and vertical axes, or not repeated at all.

## Examples

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

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

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

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

  const containerStyles = {
    style1: {
      backgroundOrigin: "content-box" as const,
      backgroundPosition: "left top" as const,
      backgroundRepeat: "no-repeat" as const,
    },
    style2: {
      backgroundOrigin: "padding-box" as const,
      backgroundPosition: "50% 50%",
      backgroundRepeat: "repeat-x" as const,
    },
    style3: {
      backgroundOrigin: "border-box" as const,
      backgroundPosition: "30px 40px",
      backgroundRepeat: "repeat" as const,
    },
    style4: {
      backgroundOrigin: "content-box,border-box" as const,
      backgroundPosition: "50% 40px, right bottom",
      backgroundRepeat: "repeat-y,repeat-x" as const,
    },
  };

  return (
    <scroll-view className="root" scroll-orientation="vertical">
      <view className="fixed_area" style={fixedAreaStyle}>
        <view className="container image1" style={containerStyles.style1}></view>
        <view className="container image1" style={containerStyles.style2}></view>
        <view className="container image1" style={containerStyles.style3}></view>
        <view className="container image2" style={containerStyles.style4}></view>
      </view>
    </scroll-view>
  );
};

root.render(<BackgroundRepeat />);

```

v0.11.0



## Syntax

```css
background-repeat: repeat-x;
background-repeat: repeat-y;
background-repeat: repeat;
background-repeat: space;
background-repeat: round;
background-repeat: no-repeat;

background-repeat: repeat space;
background-repeat: repeat repeat;
background-repeat: round space;
background-repeat: no-repeat round;
```

### Values

- Default value **repeat** 

  The image is repeated as much as needed to cover the whole background image painting area. The last image will be clipped if it doesn't fit.

- no-repeat 

  The image is not repeated (and hence the background image painting area will not necessarily be entirely covered). The position of the non-repeated background image is defined by `background-position`(./background-position).

- repeat-x 

  Repeat along x-axis.

- repeat-y 

  Repeat along y-axis.

- space 

  The image is repeated as much as possible without clipping. The first and last images are pinned to either side of the element, and whitespace is distributed evenly between the images. And `background-position`(./background-position) is ignored.

- round 

  As the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room (space left \>= half of the image width) for another one to be added.

:::info
The rendering behavior of the `space` and `round` keywords is actually the same as that of `repeat`.
:::

## Formal definition

| Initial value | repeat |
| Applies to | all elements |
| Inherited | no |
| Animatable | no |


## Formal Syntax

```
<repeat-style> = repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2}
```

## Differences from the Web

- Not support `inherit`

## Compatibility

**Compatibility Table**

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

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

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

**`background-repeat`**

**Specifications:**

