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

# bottom

APISummary
## Introduction

The `bottom` CSS property participates in specifying the vertical position. For more information, please refer to property [`position`](/next/api/css/properties/position.md).

The effect of `bottom` depends on how the element is positioned (i.e., the value of the position property):

- When position is set to `absolute` or `fixed`, the `bottom` property specifies the distance between the outer edge of the element's bottom margin and the outer edge of the containing block's bottom padding.

- When `position` is set to `relative`, the `bottom` property specifies the distance the element's bottom edge is moved above its normal position.

When both `top` and `bottom` are specified, position is set to `absolute` or `fixed`, and `height` is unspecified (either `auto` or 100%) both the `top` and `bottom` distances are respected. In all other situations, if `height` is constrained in any way or `position` is set to `relative`, the top property takes precedence and the `bottom` property is ignored.

## Examples

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

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

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

const Bottom = () => {
  const containerStyle = {
    width: "210px",
    height: "210px",
    border: "5px",
    borderColor: "black",
  };

  const firstBoxStyle = {
    position: "absolute" as const,
    bottom: "80px",
    width: "50px",
    height: "50px",
    backgroundColor: "red",
  };

  const secondBoxStyle = {
    position: "fixed" as const,
    bottom: "155px",
    width: "50px",
    height: "50px",
    backgroundColor: "green",
  };

  const thirdBoxStyle = {
    position: "relative" as const,
    bottom: "10px",
    width: "50px",
    height: "50px",
    backgroundColor: "yellow",
  };

  const fourthBoxStyle = {
    width: "50px",
    height: "50px",
    backgroundColor: "blue",
  };

  return (
    <view style={containerStyle}>
      <view style={firstBoxStyle}></view>
      <view style={secondBoxStyle}></view>
      <view style={thirdBoxStyle}></view>
      <view style={fourthBoxStyle}></view>
    </view>
  );
};

root.render(<Bottom />);

```

v0.11.0



## Syntax

```css
/* <length> values */
bottom: 3px;
bottom: 2rpx;
bottom: 2.4em;
bottom: 3rem;

bottom: 10%;

/* Keyword value */
bottom: auto;

/* calc */
bottom: calc(1px + 1px);
```

### Values

- [`<length>`](/next/api/css/data-type/length.md)

  A negative, null, or positive [`<length>`](/next/api/css/data-type/length.md) that represents:

  - for absolutely positioned elements, the distance to the bottom edge of the containing block.
  - for relatively positioned elements, the distance that the element is moved above its normal position.

- [`<percentage>`](/next/api/css/data-type/percentage.md)

  Defines the height as a percentage of the [containing block](https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block)'s height.

- `auto`

  **Default value**.

## Formal definition

| Initial value | auto |
| Applies to | all elements |
| Inherited | no |
| Animatable | yes |
| Percentages | refer to the height of the containing block |


## Formal syntax

```
bottom =
  auto                |
  <length-percentage>

<length-percentage> =
  <length>      |
  <percentage>
```

## Compatibility

**Compatibility Table**

**Query:** `css.properties.bottom`

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

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

**`bottom`**

**Specifications:**

