Styl minHeight Właściwość
Przykład
Ustaw minimalną wysokość elementu <div>:
document.getElementById("myDIV").style.minHeight = "100px";
Definicja i użycie
Właściwość minHeight ustawia lub zwraca minimalną wysokość elementu.
Właściwość minHeight ma wpływ tylko na elementy na poziomie bloku lub na elementy z bezwzględną lub stałą pozycją.
Wskazówka: Aby ustawić lub zwrócić maksymalną wysokość elementu, użyj właściwości maxHeight .
Obsługa przeglądarki
Property | |||||
---|---|---|---|---|---|
minHeight | Yes | Yes | Yes | Yes | Yes |
Składnia
Zwróć właściwość minHeight:
object.style.minHeight
Ustaw właściwość minHeight:
object.style.minHeight = "length|%|initial|inherit"
Wartości nieruchomości
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 |
Szczegóły techniczne
Domyślna wartość: | 0 |
---|---|
Wartość zwrotu: | String, reprezentujący minimalną wysokość elementu |
Wersja CSS | CSS2 |
Więcej przykładów
Przykład
Zwróć minimalną wysokość elementu <div>:
alert(document.getElementById("myDiv").style.minHeight);
Powiązane strony
Samouczek CSS: wymiar CSS
Odniesienie CSS: właściwość min-height
❮ Obiekt stylu