The CSS block flow direction is the direction in which block-level boxes and successive line boxes progress in the relevant flow. The writing-mode property determines this direction: horizontal-tb progresses top to bottom, vertical-rl right to left, and vertical-lr left to right.[ref]
For an own geometry example, take three ordinary in-flow block boxes with zero margins, borders and padding, each having inline size and block size CSS pixels. Assume no conflicting sizing constraints and a containing region sized to fit them. In horizontal-tb, the parent is pixels wide and high. The boxes occupy successive vertical intervals , and .
In vertical-rl, those same CSS logical dimensions give a parent pixels wide and high. Measuring physical from the left edge, the first box occupies , the second and the third . Their source order is unchanged, but the block progression runs toward decreasing physical . These are stipulated box geometries, not font-dependent text measurements.[ref]
CSS inline direction concerns progression within a line and its base directionality. Setting direction: rtl in an otherwise horizontal example does not make the block stack run upward: writing-mode still supplies its top-to-bottom block flow. Likewise, the rl in vertical-rl describes block progression rather than simply naming right-to-left text ordering.
This distinction also affects CSS scroll origin, whose default anchor uses block-start and inline-start. In the horizontal example, block-start is top; in the vertical right-to-left block flow it is right. Rules expressed using logical starts and sizes can therefore follow the layout convention instead of hard-coding one physical edge.[ref]
A writing-mode change determines line orientation and block progression, while CSS glyph orientation determines how text is laid out inside those lines. Treating all three as a single rotation would lose these separate layout effects.

Articles by others on the same topic (0)

There are currently no matching articles.