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

# min-height

APISummary
## Introduction

To specify min height of a view. It prevents the applied value of [`height`](/next/api/css/properties/height.md) becoming larger than the specified value of `min-height`.
The priority of `min-height` is higher than [`height`](/next/api/css/properties/height.md) but lower than [`max-height`](/next/api/css/properties/max-height.md).

## Examples

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

**Entry:** `src/min-height`
**Bundle:** `dist/min-height.lynx.bundle`

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

const MinHeight = () => {
  const containerStyle = {
    display: "linear" as const,
    linearDirection: "row" as const,
  };

  const firstBoxStyle = {
    height: "300px",
    backgroundColor: "green",
    width: "100px",
  };

  const secondBoxStyle = {
    height: "0px",
    backgroundColor: "yellow",
    width: "100px",
    minHeight: "300px",
  };

  const thirdBoxStyle = {
    height: "0px",
    backgroundColor: "blue",
    width: "100px",
    minHeight: "300px",
    maxHeight: "200px",
  };

  return (
    <view className="intro" style={containerStyle}>
      <view style={firstBoxStyle}>
        <text>height: 300px</text>
      </view>
      <view style={secondBoxStyle}>
        <text>height: 0px; min-height: 300px</text>
      </view>
      <view style={thirdBoxStyle}>
        <text>height: 0px; min-height: 300px; max-height: 200px</text>
      </view>
    </view>
  );
};

root.render(<MinHeight />);

```

v0.11.0



## Syntax

```css
/* <length> */
min-height: 120px;
min-height: 10em;

/* <percentage> */
min-height: 75%;
```

### Values

#### `<length>`

[`<length>`](/next/api/css/data-type/length.md) defines the min-height as an absolute value. Default to `0px`.

#### `<percentage>`

Defines the `min-height` as a percentage of the containing block's height.

## Formal definition

| Initial value | 0px |
| Applies to | all elements |
| Inherited | no |
| Animatable | yes |
| Percentages | The percentage is calculated with respect to the height of the generated box's containing block |


## Formal syntax

```
min-height = <length-percentage [0,∞]>

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

## Differences from the Web

[mdn:min-height](https://developer.mozilla.org/en-US/docs/Web/CSS/min-height)

1. In Lynx, the priority of `max-height` is higher than `height` and `min-height`. While in Web, `max-height` overrides `height`, but `min-height` overrides `max-height`.
2. If `max-height` is specified smaller than `min-height`, `min-height` will be ignored.
3. `auto` is not supported, default value is `0px`.
4. `max-content`, `min-content`, `fit-content`, `min-content` are not supported.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.min-height`

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

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

**`min-height`**

sets the minimum height of an element.

**Specifications:**

