CSS min-height Свойство
Пример
Установите минимальную высоту элемента <p> на 200 пикселей:
p.ex1
{
min-height: 200px;
}
Определение и использование
Свойство min-height
определяет минимальную высоту элемента.
Если содержимое меньше минимальной высоты, будет применена минимальная высота.
Если содержимое больше минимальной высоты, свойство
min-height
не имеет эффекта.
Примечание: Это предотвращает значение свойства Height, которое становится меньше min-height
.
Значение по умолчанию: | 0 |
---|---|
Inherited: | no |
Animatable: | yes, see individual properties. Читайте о animatable |
Version: | CSS2 |
Синтаксис JavaScript: | object.style.minHeight="400px" |
Поддержка браузера
Номера в таблице указывают первую версию браузера, которая полностью поддерживает свойство.
Свойство | |||||
---|---|---|---|---|---|
min-height | 1.0 | 7.0 | 3.0 | 2.0.2 | 4.0 |
Синтаксис CSS
min-height: length|initial|inherit;
Значения свойств
Значение | Описание | |
---|---|---|
length | Значение по умолчанию — 0. Определяет минимальную высоту в пикселах, см и т. д. читать о единицах длины | |
% | Определяет минимальную высоту в процентах от содержащего блока | |
initial | Присваивает этому свойству значение по умолчанию. (Читайте о initial) | |
inherit | Наследует это свойство из родительского элемента. (Читайте о inherit) |
Похожие страницы
CSS Справочник: CSS Height and Width
CSS Справка: max-height Свойство
HTML DOM Справочник: minHeight Свойство