kb/data/developer.mozilla.org/en-US/docs/Glossary/Alignment_Subject-0.md

11 KiB

title chunk source category tags date_saved instance
Alignment subject - Glossary | MDN 1/3 https://developer.mozilla.org/en-US/docs/Glossary/Alignment_Subject reference web, html, css, javascript, documentation 2026-05-05T05:24:12.904768+00:00 kb-cron

MDN HTML HTML: Markup language

HTML reference

HTML guides

Markup languages

CSS CSS: Styling language

CSS reference

CSS guides

Layout cookbook

JavaScriptJS JavaScript: Scripting language

JS reference

JS guides

Web APIs Web APIs: Programming interfaces

Web API reference

Web API guides

All All web technology

Technologies

Topics

Learn Learn web development

Frontend developer course

Learn HTML

Learn CSS

Learn JavaScript

Tools Discover our tools

About Get to know MDN better

Blog

  1. Glossary
  2. Alignment subject

Alignment subject

In CSS box alignment the alignment subject is the thing (or things) being aligned within the alignment container by the property. For justify-self and align-self, the alignment subject is the margin box of the box the property is set on, using the writing mode of that box. For justify-content and align-content, the writing mode of the box is also used. The definition of the alignment subject depends on the layout mode being used.

Block containers (including table cells)

The entire content of the block as a single unit.

Multicol containers

The column boxes, with any spacing inserted between column boxes added to the relevant column gaps.

Flex containers

For justify-content, the flex items in each flex line. For align-content, the flex lines. Note, this only has an effect on multi-line flex containers.

Grid containers

The grid tracks in the appropriate axis, with any spacing inserted between tracks added to the relevant gutters. Collapsed gutters are treated as a single opportunity for space insertion.

In this article

See also