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

# relative-left-of

APISummary
## Introduction

The current element is to the left of the sibling element specified corresponding to [`id`](/next/api/css/properties/relative-id.md) in [relative-layout](/next/guide/ui/layout/relative-layout.md).

## Examples

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

**Entry:** `src/relative-left-of`
**Bundle:** `dist/relative-left-of.lynx.bundle`

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

const RelativeLeftOf = () => {
  const containerStyle = {
    display: "relative" as const,
    relativeLayoutOnce: true,
    marginTop: "20px" as const,
    marginBottom: "20px" as const,
  };

  const titleStyle = {
    fontSize: "50rpx" as const,
    alignSelf: "center" as const,
    fontWeight: "900" as const,
    color: "linear-gradient(120deg ,#0095ff 30% ,#42d392 100%)" as const,
  };

  const view1Style = {
    relativeId: "1",
    relativeAlignRight: "parent" as const,
    display: "linear" as const,
    backgroundColor: "lightgreen",
    alignItems: "center" as const,
    textAlign: "center" as const,
  };

  const view2Style = {
    display: "linear" as const,
    relativeLeftOf: "1",
    alignItems: "center" as const,
    relativeAlignBottom: "parent" as const,
    backgroundColor: "lightblue",
  };

  const view3Style = {
    display: "linear" as const,
    relativeLeftOf: "1" as const,
    relativeCenter: "vertical" as const,
    alignItems: "center" as const,
    backgroundColor: "pink",
  };
  const textStyle = {
    fontSize: "25rpx" as const,
    fontWeight: "500" as const,
    textAlign: "center" as const,
  };

  return (
    <view className="container" style={containerStyle}>
      <view style={view1Style}>
        <text style={textStyle}>relative-id: 1</text>
        <text style={textStyle}>relative-align-right: parent</text>
      </view>
      <view style={view2Style}>
        <text style={textStyle}>relative-left-of: 1</text>
        <text style={textStyle}>relative-align-bottom: parent</text>
      </view>
      <view style={view3Style}>
        <text style={textStyle}>relative-left-of: 1</text>
        <text style={textStyle}>relative-center: vertical</text>
      </view>
    </view>
  );
};

root.render(<RelativeLeftOf />);

```

v0.11.0



## Syntax

```css
relative-left-of: none;
relative-left-of: 1;
relative-left-of: 2;
```

### Values

#### `none`

**Default Value**. Act as not set this property.

#### `<number>`

`int` only. Specifies the sibling element number.(refer to [`relative-id`](/next/api/css/properties/relative-id.md)).

:::info
Attention please when setting [`relative-id`](/next/api/css/properties/relative-id.md): `-1` and `0` are special values. `-1` is the default value, indicating that the current element will not be considered as the alignment reference standard for sibling elements. Using `0` as an element ID is not allowed, as it will result in unexpected behavior.
:::

## Formal definition

| Initial value | `none` |
| Applies to | relative items |
| Inherited | no |
| Animatable |  |


## Formal syntax

```
relative-left-of = none | <number>
```

## Differences from the Web

- There is no such style in web.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.relative-left-of`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/139-relative-left-of.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| relative-left-of | Yes (1.4) | Yes (3.4) | Yes (1.4) | Yes (1.4) | Yes (1.4) | No |

**`relative-left-of`**

The current element is to the left of the sibling element specified corresponding to id.

**Specifications:**

