Estilo minHeight Propiedad
Ejemplo
Establezca la altura mínima de un elemento <div>:
document.getElementById("myDIV").style.minHeight = "100px";
Definición y uso
La propiedad minHeight establece o devuelve la altura mínima de un elemento.
La propiedad minHeight solo tiene efecto en elementos a nivel de bloque o en elementos con posición absoluta o fija.
Sugerencia: para establecer o devolver la altura máxima de un elemento, use la propiedad maxHeight .
Compatibilidad con navegador
Property | |||||
---|---|---|---|---|---|
minHeight | Yes | Yes | Yes | Yes | Yes |
Sintaxis
Devuelve la propiedad minHeight:
object.style.minHeight
Establezca la propiedad minHeight:
object.style.minHeight = "length|%|initial|inherit"
Valores de propiedad
Value | Description |
---|---|
length | Defines the minimum height in length units. Default is 0 |
% | Defines the minimum height in % of the parent element |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Detalles técnicos
Valor por defecto: | 0 |
---|---|
Valor de retorno: | Una cadena, que representa la altura mínima de un elemento. |
Versión CSS | CSS2 |
Más ejemplos
Ejemplo
Devuelve la altura mínima de un elemento <div>:
alert(document.getElementById("myDiv").style.minHeight);
páginas relacionadas
Tutorial CSS: Dimensión CSS
Referencia de CSS: propiedad min-height
❮ Objeto de estilo