Skip to content
This repository was archived by the owner on Feb 27, 2026. It is now read-only.

Commit 78400ed

Browse files
Enhance align-items documentation clarity
Updated the description and clarified the explanation of the `align-items` property in flexbox and grid contexts. Added a section for common `align-items` values in flexbox.
1 parent e4175d6 commit 78400ed

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

content/css/concepts/flexbox/terms/align-items/align-items.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Title: 'align-items'
3-
Description: Controls how items are aligned within a container
3+
Description: 'Sets how items are aligned along the cross axis in flex containers and the block axis in grid containers.'
44
Subjects:
55
- 'Web Design'
66
- 'Web Development'
@@ -13,7 +13,7 @@ CatalogContent:
1313
- 'paths/front-end-engineer-career-path'
1414
---
1515

16-
**`align-items`** is a flexbox and grid property that specifies how items inside a container are aligned. In flexbox, align-items controls how these items are aligned across the cross-axis (the axis perpendicular to the main axis), which is specified by flex-direction. In a grid, it controls the alignment in the block direction (vertical by default)..
16+
**`align-items`** sets how items are aligned inside a flex or grid container. In flexbox, it controls alignment along the cross-axis (perpendicular to the main axis defined by `flex-direction`). In grid, it controls alignment along the block axis within each grid area (vertical by default in horizontal writing modes).
1717

1818
## Syntax
1919

@@ -24,7 +24,7 @@ align-items: <value>;
2424
**Parameters:**
2525

2626
- `<value>`: Specifies how items inside a container are aligned. Common values include:
27-
- `stretch (default)`
27+
- `stretch` (default)
2828
- `flex-start`
2929
- `flex-end`
3030
- `center`
@@ -34,11 +34,11 @@ align-items: <value>;
3434

3535
**Return value:**
3636

37-
- None. This property sets a layout rule and does not return a value.
37+
None. This property sets a layout rule and does not return a value.
3838

3939
## Example 1: Using `align-items` with flex
4040

41-
In this example, `align-items: center` is applied to a flex container to align its child elements vertically centered along the cross-axis.
41+
In this example, `align-items: center` is applied to a flex container to align its child elements vertically centered along the cross-axis:
4242

4343
```css
4444
.container {
@@ -72,6 +72,8 @@ The output of the code above is shown below:
7272

7373
![align-items implementation using grid where the paragraphs inside 'div' are positioned at the end](https://raw.githubusercontent.com/Codecademy/docs/main/media/css-align-items-2.jpg)
7474

75-
The image below shows some of the align-items property values in flexbox and their corresponding alignment.
75+
## Common `align-items` Values in Flexbox
76+
77+
The image below illustrates how different align-items values affect vertical alignment in a flex container:
7678

7779
![align-items property values in flexbox and their corresponding alignment](https://raw.githubusercontent.com/Codecademy/docs/main/media/css-align-items-illustration.jpg)

0 commit comments

Comments
 (0)