liveBook · Manning

Inline-size

As explained in CSS in Depth, Second Edition

The CSS inline-size property specifies an element's size along its inline axis, adapting to the writing mode.

inline-size sets an element’s size along its inline axis instead of prescribing a physical width or height. In horizontal writing modes it behaves like width; in vertical writing modes it adapts to the corresponding height. section 3.1.2

Use inline-size when the layout should follow writing-mode directions:

  • Prefer inline-size to width when the element must remain correct across horizontal and vertical writing modes. section 3.1.2
  • Remember that a block-level input may not fill its container automatically; inline-size: 100% forces the intended available inline size. section 4.3.2
  • Use block-size as the logical counterpart when controlling the dimension along the block axis. section 3.1.2

Full-width login fields

A login form can make text and password fields occupy the form’s available inline space without relying on the input element’s size attribute: .login-form input:not([type=checkbox]):not([type=radio]) { display: block; inline-size: 100%; } The selector leaves checkbox and radio inputs untouched, while inline-size: 100% overrides their default character-based width. section 4.3.2

Figure 3.5 Inline and block directions in various writing modes
figure

Compare inline and block directions across writing modes to see why logical sizing can change physical orientation. section 3.1.2

How CSS in Depth, Second Edition covers it

How deep it goes
Explains logical-axis behavior and demonstrates a practical form rule, without covering broader sizing conflicts or algorithms.
Examples
Uses a login form whose text and password inputs receive display:block and inline-size:100%.
What you can do after
Apply it via CSS to size elements responsively across writing modes and explicitly fill login-form inputs.
How it connects
Connects logical properties with writing modes, inline axis, block axis, width, height, and block-size.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of CSS in Depth, Second Edition. The section links point to the parts of the book it draws on.