> 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-bottom-of

APISummary
## 介绍

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

## 使用示例

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

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

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

const RelativeBottomOf = () => {
  const containerStyle = {
    display: "relative" as const,
  };

  const firstViewStyle = {
    display: "linear" as const,
    relativeId: "1",
    relativeCenter: "vertical" as const,
    backgroundColor: "lightgreen",
    alignItems: "center" as const,
    width: "40%",
  };

  const secondViewStyle = {
    display: "linear" as const,
    relativeBottomOf: "1",
    relativeAlignRight: "parent",
    backgroundColor: "lightblue",
    alignItems: "center" as const,
    width: "40%",
  };

  const thirdViewStyle = {
    relativeBottomOf: "1" as const,
    backgroundColor: "pink",
  };

  const textStyle = {
    fontSize: "35rpx" as const,
    fontWeight: "600" as const,
    textAlign: "center" as const,
  };

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

root.render(<RelativeBottomOf />);

```

v0.11.0



## 语法

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

### 取值

#### `none`

**默认值**。不设置此属性。

#### `<number>`

`int` 值。设置当前元件在指定对应 [`id`](/next/zh/api/css/properties/relative-id.md) 的同级元件的下方。

:::info
[`id`](/next/zh/api/css/properties/relative-id.md) 的设定请注意：`-1` 和 `0` 是特殊值。`-1` 是默认值，代表当前元件不会被视为同级元件的对齐参考标准。不能使用 `0` 作为元件的 id，否则有不符合预期的表现。
:::

## 形式定义

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


## 形式语法

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

## 与 Web 的区别

- Web 无此属性。

## 兼容性

**Compatibility Table**

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

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

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

**`relative-bottom-of`**

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

**Specifications:**

