docs.rodeo

MDN Web Docs mirror

CSS logical properties and values

{{CSSRef}} 

The CSS logical properties and values module defines logical properties and values that can control layout through logical rather than physical direction and dimension mappings. Logical properties define direction‐relative equivalents to their corresponding physical properties.

The start of a line is not always the left side of a line. Different writing systems operate in various directions. For example:

The logical properties defined in this module enable defining properties relative to the content’s writing direction, rather than a physical direction. This means content translated into languages with different writing modes will be rendered as intended.

Logical properties and values use the abstract terms block and inline to describe the direction in which they flow. The physical meaning of these terms depends on the writing mode.

The block dimension is perpendicular to the flow of text within a line, i.e., the vertical dimension in horizontal writing modes, and the horizontal dimension in vertical writing modes. For standard English text, it is the vertical dimension.

The inline dimension is parallel to the flow of text within a line, i.e., the horizontal dimension in horizontal writing modes, and the vertical dimension in vertical writing modes. For standard English text, it is the horizontal dimension.

CSS was initially designed with only physical coordinates. The logical properties and values module defines flow–relative equivalents for many values and properties. Properties that once only accepted physical values (top, bottom, left, right) now also accept flow-relative logical values (block-start, block-end, inline-start, inline-end).

Reference

Properties

Data types and values

{{glossary("Flow relative values")}} :

Glossary terms

Guides

CSS box model

CSS box sizing

CSS backgrounds and borders

CSS positioned layout

CSS writing modes

CSS containment

CSS overflow

CSS overscroll behavior

Specifications

{{Specifications}} 

See also

In this article

View on MDN