You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 27, 2026. It is now read-only.
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.
Copy file name to clipboardExpand all lines: content/css/concepts/flexbox/terms/align-items/align-items.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
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.'
4
4
Subjects:
5
5
- 'Web Design'
6
6
- 'Web Development'
@@ -13,7 +13,7 @@ CatalogContent:
13
13
- 'paths/front-end-engineer-career-path'
14
14
---
15
15
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).
17
17
18
18
## Syntax
19
19
@@ -24,7 +24,7 @@ align-items: <value>;
24
24
**Parameters:**
25
25
26
26
-`<value>`: Specifies how items inside a container are aligned. Common values include:
27
-
-`stretch (default)`
27
+
-`stretch` (default)
28
28
-`flex-start`
29
29
-`flex-end`
30
30
-`center`
@@ -34,11 +34,11 @@ align-items: <value>;
34
34
35
35
**Return value:**
36
36
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.
38
38
39
39
## Example 1: Using `align-items` with flex
40
40
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:
42
42
43
43
```css
44
44
.container {
@@ -72,6 +72,8 @@ The output of the code above is shown below:
72
72
73
73

74
74
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:
76
78
77
79

0 commit comments