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

# relative-inline-end-of

APISummary
## 介绍

[相对布局](/next/zh/guide/ui/layout/relative-layout.md)中，指定当前元件在指定对应 [`id`](/next/zh/api/css/properties/relative-id.md) 的同级元件的左/右侧。

当 [`direction`](/next/zh/api/css/properties/direction.md) 为 `ltr` 时，`relative-inline-end-of` 等价于 [`relative-right-of`](/next/zh/api/css/properties/relative-right-of.md)；

当 [`direction`](/next/zh/api/css/properties/direction.md) 为 `rtl/lynx-rtl` 时，`relative-inline-end-of` 等价于 [`relative-left-of`](/next/zh/api/css/properties/relative-left-of.md)。

## 使用示例

**下面是一个示例: css-api**

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

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

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

  const container2Style = {
    display: "relative" as const,
    relativeLayoutOnce: true,
    direction: "rtl" 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",
    relativeCenter: "horizontal" as const,
    display: "linear" as const,
    backgroundColor: "lightgreen",
    alignItems: "center" as const,
    textAlign: "center" as const,
  };

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

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

  return (
    <scroll-view className="root" scroll-orientation="vertical">
      <text style={titleStyle}>direction: ltr</text>
      <view className="container" style={containerStyle}>
        <view style={view1Style}>
          <text style={textStyle}>relative-id: 1</text>
          <text style={textStyle}>relative-center: horizontal</text>
        </view>
        <view style={view2Style}>
          <text style={textStyle}>relative-inline-end-of: 1</text>
          <text style={textStyle}>relative-align-bottom: parent</text>
        </view>
        <view style={view3Style}>
          <text style={textStyle}>relative-inline-end-of: 1</text>
          <text style={textStyle}>relative-center: vertical</text>
        </view>
      </view>
      <text style={titleStyle}>direction: rtl</text>
      <view className="container" style={container2Style}>
        <view style={view1Style}>
          <text style={textStyle}>relative-id: 1</text>
          <text style={textStyle}>relative-center: horizontal</text>
        </view>
        <view style={view2Style}>
          <text style={textStyle}>relative-inline-end-of: 1</text>
          <text style={textStyle}>relative-align-bottom: parent</text>
        </view>
        <view style={view3Style}>
          <text style={textStyle}>relative-inline-end-of: 1</text>
          <text style={textStyle}>relative-center: vertical</text>
        </view>
      </view>
    </scroll-view>
  );
};

root.render(<RelativeInlineEndOf />);

```

v0.11.0



## 语法

```css
relative-inline-end-of: none;
relative-inline-end-of: 1;
relative-inline-end-of: 2;
```

### 取值

取值与 [`relative-left-of`](/next/zh/api/css/properties/relative-left-of.md) 属性相同。

## 形式定义

| 初始值 | `none` |
| 适用元素 | relative items |
| 是否支持继承 | 否 |
| 是否支持动画 |  |


## 形式语法

```
relative-inline-end-of = none | <number>
```

## 与 Web 的区别

- Web 无此属性。

## 兼容性

**Compatibility Table**

**Query:** `css.properties.relative-inline-end-of`

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

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| relative-inline-end-of | Yes (2.0) | Yes (3.4) | Yes (2.0) | Yes (2.0) | Yes (2.0) | No |

**`relative-inline-end-of`**

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

**Specifications:**

