스타일 maxHeight 속성
예시
<div> 요소의 최대 높이를 설정합니다.
document.getElementById("myDIV").style.maxHeight = "15px";
정의 및 사용
maxHeight 속성은 요소의 최대 높이를 설정하거나 반환합니다.
maxHeight 속성은 블록 수준 요소 또는 절대 위치 또는 고정 위치의 요소에만 영향을 미칩니다.
참고: 요소의 높이는 maxHeight 속성에 지정된 값보다 클 수 없습니다.
팁: 요소의 최소 높이를 설정하거나 반환하려면 minHeight 속성을 사용하십시오.
브라우저 지원
Property | |||||
---|---|---|---|---|---|
maxHeight | Yes | Yes | Yes | Yes | Yes |
통사론
maxHeight 속성을 반환합니다.
object.style.maxHeight
maxHeight 속성을 설정합니다.
object.style.maxHeight = "none|length|%|initial|inherit"
속성 값
Value | Description |
---|---|
none | No limit on the height of the element. This is default |
length | Defines the maximum height in length units |
% | Defines the maximum 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 |
기술적 세부 사항
기본값: | 없음 |
---|---|
반환 값: | 요소의 최대 높이를 나타내는 문자열 |
CSS 버전 | CSS2 |
더 많은 예
예시
<div> 요소의 최대 높이를 반환합니다.
alert(document.getElementById("myDIV").style.maxHeight);
관련 페이지
CSS 튜토리얼: CSS 차원
CSS 참조: 최대 높이 속성
❮ 스타일 개체