Logical Properties
suggest changeLogical properties describe layout relative to the writing mode rather than fixed physical directions:
.callout {
padding-block: 1rem;
padding-inline: 1.5rem;
margin-block: 2rem;
border-inline-start: 0.25rem solid currentColor;
max-inline-size: 65ch;
}
In a left-to-right horizontal writing mode, inline-start corresponds to the left and block-start to the top. Those mappings change for right-to-left text and vertical writing modes.
Common mappings include:
| Physical property | Logical alternative |
|---|---|
width, height |
inline-size, block-size |
min-width, max-width |
min-inline-size, max-inline-size |
margin-left, margin-right |
margin-inline-start, margin-inline-end |
top, bottom |
inset-block-start, inset-block-end |
Prefer logical properties for components intended to work across languages and writing modes. Use physical properties when the direction is inherently physical, such as positioning a decorative element at the top of an image.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents