Web4College

CSS block-size property

src

Description

CSS block-size property is a logical property and represents height or width for an element. The selection of height or width depends upon the writing-mode.

  • The block-size represents height for the horizontal-tb writing-mode.

  • The block-size represents width for the vertical-* writing-mode.

Change the direction of flow of text.

horizontal-tb vertical-lr vertical-rl

Syntax

block-size : auto | +ve length

Property values

autoDefault

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

block-size: auto;
Try it

+ve length

300

It specifies the fixed size of a block.

block-size: 300px;
Try it

Applicable to

It applies to all elements except non-replaced inline.