max-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.
* Some parts of this feature may have varying levels of support.
Resumen
La propiedad max-height se utiliza para definir la altura máxima de un elemento dado. Impide que el valor de la altura pueda llegar a ser más grande que la de max-height.
Valor inicial:ninguno- Se aplica a : elementos de bloque o remplazados
Valor heredado: no- Porcentajes: se refiere a la altura del bloque contenedor.
- Medio:
visual Valor calculado:
Sintaxis
max-height: <length> | <percentage>
Valores
- none : la
alturano tiene valor máxima. - length : puede ser en px, cm, in (píxel, centímetro o inches)
- percentage : % especificado como un porcentaje de la altura del bloque contenedor.
Ejemplos
table { max-height: 75%; }
form { max-height: none; }
Notas
max-height sobrescribe height, pero no min-height.
Especificaciones
| Specification |
|---|
| CSS Box Sizing Module Level 4 # width-height-keywords |
| CSS Box Sizing Module Level 4 # sizing-values |
Compatibilidad con navegadores
BCD tables only load in the browser