min-block-size

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.

Experimental: Esta es una tecnología experimental
Comprueba la Tabla de compabilidad de navegadores cuidadosamente antes de usarla en producción.

La propiedad de CSS min-block-size define el tamaño mínimo horizontal o vertical de un elemento de bloque, dependiendo de los modos de escritura. Esto corresponde ya sea a la propiedad min-width o a la propiedad min-height, dependiendo del valor de writing-mode.

Pruébalo

Sintaxis

css
/* <length> values */
min-block-size: 100px;
min-block-size: 5em;

/* <percentage> values */
min-block-size: 10%;

/* Keyword values */
min-block-size: max-content;
min-block-size: min-content;
min-block-size: fit-content;
min-block-size: fill-available;

/* Global values */
min-block-size: inherit;
min-block-size: initial;
min-block-size: unset;

Si el modo de escritura es verticalmente orientado, el valor de min-block-size se relaciona con el mínimo ancho del elemento; de otra manera, se relaciona al mínimo alto del elemento. Una propiedad relacionada es min-inline-size, que define la otra dimensión del elemento.

Valor inicial0
Applies tosame as width and height
Heredableno
Percentagesblock-size of containing block
Valor calculadosame as min-width and min-height
Animation typea CSS data type are interpolated as real, floating-point numbers.">length, CSS data type are interpolated as real, floating-point numbers.">percentage or calc();

Valores

La propiedad min-block-size toma los mismos valores de las propiedades min-width y min-height.

Sintaxis formal

min-block-size = 
<'min-width'>

<min-width> =
auto |
<length-percentage [0,∞]> |
min-content |
max-content |
fit-content( <length-percentage [0,∞]> ) |
<calc-size()> |
<anchor-size()>

<length-percentage> =
<length> |
<percentage>

<calc-size()> =
calc-size( <calc-size-basis> , <calc-sum> )

<anchor-size()> =
anchor-size( [ <anchor-name> || <anchor-size> ]? , <length-percentage>? )

<calc-size-basis> =
<intrinsic-size-keyword> |
<calc-size()> |
any |
<calc-sum>

<calc-sum> =
<calc-product> [ [ '+' | '-' ] <calc-product> ]*

<anchor-name> =
<dashed-ident>

<anchor-size> =
width |
height |
block |
inline |
self-block |
self-inline

<calc-product> =
<calc-value> [ [ '*' | '/' ] <calc-value> ]*

<calc-value> =
<number> |
<dimension> |
<percentage> |
<calc-keyword> |
( <calc-sum> )

<calc-keyword> =
e |
pi |
infinity |
-infinity |
NaN

Ejemplo

Contenido HTML

html
<p class="exampleText">Example text</p>

Contenido CSS

css
.exampleText {
  writing-mode: vertical-rl;
  background-color: yellow;
  min-block-size: 200px;
}

Especificaciones

Specification
CSS Logical Properties and Values Level 1
# propdef-min-block-size
CSS Box Sizing Module Level 4
# sizing-values

Compatibilidad con navegadores

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

Mira también