CSSblock-size Property
Example
Set the size of a <div> element in the block direction:
block-size: 200px;
}
More "Try it Yourself" examples below.
Definition and Usage
Theblock-size property specifies the size of an element in the block direction.
Note: The related CSS propertywriting-mode defines block direction, and this affects the result of theblock-size property. For pages in English, block direction is downward and inline direction is left to right.
The CSSblock-size andinline-size properties are very similar to CSS propertieswidth andheight, but theblock-size andinline-size properties are dependent on block and inline directions.
| Default value: | auto |
|---|---|
| Inherited: | no |
| Animatable: | yes.Read aboutanimatableTry it |
| Version: | CSS3 |
| JavaScript syntax: | object.style.blockSize="100px"Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| block-size | 57.0 | 79.0 | 41.0 | 12.1 | 44.0 |
CSS Syntax
Property Values
| Value | Description | Demo |
|---|---|---|
| auto | Default. The element's default block-size value. | Demo ❯ |
| length | Specifies block-size in px, pt, cm, etc.Read about length units | Demo ❯ |
| % | Specifies block-size in percent relative to size of parent element on the corresponding axis. | Demo ❯ |
| initial | Sets this property to its default value.Read aboutinitial | |
| inherit | Inherits this property from its parent element.Read aboutinherit |
More Examples
Example
With thewriting-mode property value of a <div> element set to 'vertical-rl', block direction is moved from downwards to sideways, and this changes the direction the block-size property works in:
block-size: 250px;
writing-mode: vertical-rl;
}
Related Pages
CSS tutorial:CSS Height and Width
CSS tutorial:CSS Box model
CSS reference:height property
CSS reference:width property
CSS reference:writing-mode property

