Web4College

CSS inline-size property

src

Description

CSS inline-size property defines width or height for an element. The selection of height or width depends upon the writing-mode.

  • The inline-size behaves as width for the horizontal-tb writing-mode.

  • The inline-size behaves as height for the vertical-* writing-mode.

Change the direction of flow of text.

horizontal-tb vertical-lr vertical-rl

Syntax

inline-size : auto | +ve length | +ve percentage

Property values

autoDefault

auto value means the size will be changed automatically according to the content.

inline-size: auto;
Try it

+ve length

300

The inline-size of an element should be at least 300px.

inline-size: 300px;
Try it

+ve percentage

30

The size of an element should be 30% of the parent box.

inline-size: 30%;
Try it

Applicable to

It applies to all elements except non-replaced inline.