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 July 2015.
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 inicial | auto |
---|---|
Applies to | elementos de bloque o remplazados |
Heredable | no |
Percentages | Se refiere a la altura del bloque contenedor. |
Valor calculado | the percentage as specified or the absolute length |
Animation type | a length, percentage or calc(); |
Sintaxis
min-height =
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
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 # width-height-keywords |
CSS Box Sizing Module Level 4 # sizing-values |
Compatibilidad con navegadores
BCD tables only load in the browser