The CSS ‘block-size‘ property specifies the size of an element’s block or vertical size in a standard writing mode. It defines the height of an element in a layout where the writing mode is horizontal (like in English and most Western languages), effectively controlling how tall an element is. This property is particularly useful for layouts that need to adapt to different writing modes or when you want to set the size of a block-level element explicitly.
CSS ‘block-size’ Property Examples
See the Pen CSS ‘block-size’ Property by Webzstore (@webzstore) on CodePen.
The ‘block-size‘ property offers a robust way to manage the vertical dimensions of elements across different layouts and writing modes, enhancing CSS’s capabilities for responsive and internationalized web design.
Browser Support For ‘block-size’ Property
![]() | ![]() | ![]() | ![]() | ![]() |
| 41.0 | 12.1 | 57.0 | 79.0 | 44.0 |
CSS Syntax of the ‘block-size’ Property
block-size: auto | length | percentage | initial | inherit ;
Usage of the ‘block-size’ Property
Use ‘block-size‘ to explicitly set an element’s vertical size. This is especially relevant in responsive designs or when working with grid and flex layouts, where the size of elements may need to adjust based on content, viewport dimensions, or specific design requirements. The ‘block-size‘ property is also essential when dealing with internationalization, as it helps manage layouts that involve different writing modes.
Property Values of the ‘background’ Property
- Auto: The browser calculates the block size. This is the default and is often based on the content size.
- Length: Defines the block size with a fixed size, using units such as pixels (px), ems (em), or any other length unit.
- Percentage: Sets the block size relative to the containing block’s size.
- Initial: Resets the ‘block-size‘ to its default value (auto).
- Inherit: Inherits the ‘block-size‘ from the parent element.






Leave a Reply