Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Container Queries and Logical Properties

The min-block-size property

Reference for the CSS min-block-size property: the logical minimum height that follows the writing mode, with a live example and tips for flexible boxes.

The min-block-size property sets the smallest size an element may have along the block axis. In horizontal writing modes that is the height, so it works like min-height; in vertical writing modes it works like min-width.

Unlike a fixed block-size, a minimum lets the box grow when its content needs more room, so text is never cut off or pushed outside.

CSS
.card {
  min-block-size: 8rem;
}

Try it

Minimum height that can still grow

Syntax

CSS
min-block-size: auto | <length> | <percentage> | min-content | max-content
              | fit-content | fit-content(<length-percentage>) | stretch
  • Initial value: auto
  • Applies to: same as width and height
  • Inherited: no
  • Animatable: yes, as a length or percentage
  • Computed value: as for min-height
  • Percentages: relative to the block size of the containing block (a percentage only resolves if that size is definite)

Values

Value Description
auto For most boxes, behaves as 0. For flex and grid items in the relevant axis it is the automatic minimum size based on content.
<length> A fixed minimum such as 10rem or 100vh.
<percentage> A share of the containing block's block size, which must be definite.
min-content, max-content, fit-content Intrinsic sizing keywords; in the block axis they are usually the same as auto.
stretch The minimum is the full available block space. Newer; check a compatibility table.

Usage notes

  • Prefer a minimum over a fixed size. Text can wrap into more lines on narrow screens, with larger fonts or after translation. A min-block-size keeps a consistent look yet allows growth.
  • Full-height layouts. min-block-size: 100vh (or 100dvh, to account for mobile browser toolbars) on a page wrapper makes a short page fill the screen, while long pages can still scroll. See dynamic viewport units.
  • Percentages need a definite parent. min-block-size: 100% has an effect only if the parent has an explicit block size. In a flex or grid layout, let the container stretch the item instead.
  • Beats block-size. If the minimum is larger than the block size, the minimum wins. A max-block-size smaller than the minimum is also overridden by the minimum.
  • Flex and grid. An item's auto minimum is based on its content in the main axis, so long content can keep it from shrinking. Set min-block-size: 0 on a column flex item that should shrink and scroll (with overflow: auto).
  • Writing modes. The physical axis is chosen by the element's own writing-mode. For layouts that never rotate, min-height is equivalent.

Browser support

Supported in all current major browsers and part of Baseline; the stretch keyword is newer, so check a compatibility table.