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

# align-content

APISummary
## Introduction

In [flexible box layout](/next/guide/ui/layout/flexible-box-layout.md), the `align-content` property defines how flex lines are aligned along the **cross-axis**.

In [grid layout](/next/guide/ui/layout/grid-layout.md), the `align-content` property defines how to align grid tracks along the **block axis**.

## Examples

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

**Entry:** `src/align-content`
**Bundle:** `dist/align-content.lynx.bundle`

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

const AlignContent = () => {
  const colorBlockStyle = (color: string) => ({
    width: "100px",
    height: "50px",
    backgroundColor: color,
  });

  const fixedAreaStyle = {
    width: "100%",
    height: "100%",
    flexDirection: "column" as const,
  };

  return (
    <scroll-view className="root" scroll-orientation="vertical">
      <view className="fixed_area" style={fixedAreaStyle}>
        <text>align-content:stretch;</text>
        <view className="container1">
          <view style={colorBlockStyle("red")} />
          <view style={colorBlockStyle("yellow")} />
          <view style={colorBlockStyle("green")} />
          <view style={colorBlockStyle("blue")} />
        </view>
        <text>align-content:center;</text>
        <view className="container2">
          <view style={colorBlockStyle("red")} />
          <view style={colorBlockStyle("yellow")} />
          <view style={colorBlockStyle("green")} />
          <view style={colorBlockStyle("blue")} />
        </view>
      </view>
    </scroll-view>
  );
};

root.render(<AlignContent />);

```

v0.11.0



## Syntax

### Values

#### `stretch`

**Default value**. If the combined size of the items along the cross axis (block axis in grid layout) is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by [`max-height`](/next/api/css/properties/max-height.md)/[`max-width`](/next/api/css/properties/max-width.md) (or equivalent functionality), so that the combined size exactly fills the alignment container along the cross axis (block axis in grid layout).

#### `start`

All lines are packed starting from the start edge of the container.

#### `end`

All lines are packed starting from the end edge of the container.

#### `flex-start`

Behaves the same as `start`. Recommended to use only in flexible box layout.

#### `flex-end`

Behaves the same as `end`. Recommended to use only in flexible box layout.

#### `center`

All lines are packed toward the center of the container. Lines are tightly packed against each other and aligned centrally within the container. The distance between the cross-axis (block axis in grid layout) start edge and the first line equals the distance between the cross-axis (block axis in grid layout) end edge and the last line.

#### `space-between`

Lines are evenly distributed in the container. The spacing between each pair of adjacent lines is equal. The cross-axis (block axis in grid layout) start edge and end edge of the container are flush with the first and last lines respectively.

#### `space-around`

Lines are evenly distributed in the container, with equal space between lines. The space between the cross-axis (block axis in grid layout) start edge and the first line, and between the cross-axis (block axis in grid layout) end edge and the last line, is half the size of the space between adjacent lines.

## Formal definition

| Initial value | `stretch` |
| Applies to | flex containers/grid containers |
| Inherited | no |
| Animatable | no |


## Formal syntax

```
align-content = stretch | start | end | flex-start | flex-end | center | space-between | space-around
```

## Differences from the Web

[mdn: align-content](https://developer.mozilla.org/en/docs/Web/CSS/align-content)

1. `normal`, `baseline`, `first baseline`, and `last baseline` are not supported. Initial value is `stretch`.
2. `space-evenly` is not supported, will be supported in the future.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.align-content`

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

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| align-content | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| unsupported&#95;value&#95; | No | No | No | No | No | Yes |
| supported&#95;in&#95;flex&#95;layout | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| supported&#95;in&#95;flex&#95;layout.nested&#95;value&#95;1 | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |
| supported&#95;in&#95;flex&#95;layout.nested&#95;value&#95;2 | Yes (2.1) | Yes (3.4) | Yes (2.1) | Yes (2.1) | Yes (2.1) | Yes |
| supported&#95;in&#95;grid&#95;layout | Yes (2.1) | Yes (3.4) | Yes (2.1) | Yes (2.1) | Yes (2.1) | Yes |
| supported&#95;in&#95;grid&#95;layout.nested&#95;value&#95;1 | Yes (2.1) | Yes (3.4) | Yes (2.1) | Yes (2.1) | Yes (2.1) | Yes |
| supported&#95;in&#95;grid&#95;layout.nested&#95;value&#95;2 | Yes (2.1) | Yes (3.4) | Yes (2.1) | Yes (2.1) | Yes (2.1) | Yes |

**`align-content`**

**Specifications:**

**`unsupported_value_`**

<code>normal</code>, <code>space-evenly</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/57-align-content.json)

**`supported_in_flex_layout`**

Supported in Flexible Box Layout

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/57-align-content.json)

**`supported_in_flex_layout.nested_value_1`**

<code>stretch</code>, <code>flex-start</code>, <code>flex-end</code>, <code>center</code>, <code>space-between</code> and <code>space-around</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/57-align-content.json)

**`supported_in_flex_layout.nested_value_2`**

<code>start</code> and <code>end</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/57-align-content.json)

**`supported_in_grid_layout`**

Supported in Grid Layout

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/57-align-content.json)

**`supported_in_grid_layout.nested_value_1`**

<code>stretch</code>, <code>flex-start</code>, <code>flex-end</code>, <code>center</code>, <code>space-between</code> and <code>space-around</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/57-align-content.json)

**`supported_in_grid_layout.nested_value_2`**

<code>start</code> and <code>end</code>

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/57-align-content.json)

