기술
최대 높이의 속성은 요소의 높이에 결합 된 상부를 설정하기 위해 사용된다.
가능한 값
length− 모든 길이 단위. 요소는이 거리를 초과하는 높이 값을 가질 수 없습니다.
percentage − 요소의 높이를 컨테이너 블록 높이의 최대이 비율로 제한합니다.
none − 요소의 높이에는 제한이 없습니다.
적용
대체되지 않은 인라인 요소 및 테이블 요소를 제외한 모든 HTML 요소.
DOM 구문
object.style.maxHeight = "50px"
예
다음은 예입니다.
<html>
<head>
</head>
<body>
<p style = "width:400px; max-height:10px; border:1px solid red; padding:5px; margin:10px;">
This paragraph is 400px wide and max height is 10px
This paragraph is 400px wide and max height is 10px
This paragraph is 400px wide and max height is 10px
This paragraph is 400px wide and max height is 10px
</p>
<img alt = "logo" src = "/css/images/logo.png" width = "95" height = "84" />
</body>
</html>
이것은 다음 결과를 생성합니다-