Esta página ha sido traducida del inglés por la comunidad. Aprende más y únete a la comunidad de MDN Web Docs.

View in English Always switch to English

min-height

Baseline
Widely available
*

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

* Some parts of this feature may have varying levels of support.

Resumen

La propiedad min-height se utiliza para definir la altura mínima de un elemento dado. Impide que el valor de la propiedad height llegue a ser más pequeña que la especificada en la altura mínima (min-height).

Valor inicialauto
Applies toelementos de bloque o remplazados
Heredableno
PercentagesSe refiere a la altura del bloque contenedor.
Valor calculadothe percentage as specified or the absolute length
Animation typea length, percentage or calc();

Sintaxis

min-height = 
auto |
<box-size> |
<anchor-size()> |
contain |
fit-content( <length-percentage [0,∞]> )

<box-size> =
<length-percentage> |
stretch |
contain |
min-content |
max-content |
fit-content |
fit-content( ) |
calc-size( )

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

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

<anchor-name> =
<dashed-ident>

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

Values

  • length : puede ser en px, cm, in (píxel, centímetro o inches)
  • percentage : % especificado como un porcentaje de la altura del bloque contenedor.

Examples

table {min-height: 75%;}

form {min-height: 0;}

Notes

min-height tiene prioridad sobre los valores max-height y height.

Especificaciones

Specification
CSS Box Sizing Module Level 3
# sizing-values

Compatibilidad con navegadores

Ver también

modelo de caja, ancho, tamaño de cajas -Mozilla, altura mínima, altura máxima