--- title: height slug: Web/CSS/height tags: - CSS - CSS Property - Reference translation_of: Web/CSS/height ---
height CSS 속성은 요소의 높이를 지정합니다. 기본값은 콘텐츠 영역의 높이지만, {{cssxref("box-sizing")}}이 border-box라면 테두리 영역의 높이를 설정합니다.
{{cssxref("min-height")}}와 {{cssxref("max-height")}} 속성은 height를 덮어씁니다.
/* 키워드 */ height: auto; /* <length> */ height: 120px; height: 10em; /* <percentage> */ height: 75%; /* 전역 값 */ height: inherit; height: initial; height: unset;
border-box {{experimental_inline}}content-box {{experimental_inline}}autofill {{experimental_inline}}fill-available 인라인 크기 또는 fill-available 블록 크기를 사용.max-content {{experimental_inline}}min-content {{experimental_inline}}available {{experimental_inline}}fit-content {{experimental_inline}}<div id="taller">제 키는 50픽셀입니다.</div>
<div id="shorter">제 키는 25픽셀입니다.</div>
<div id="parent">
<div id="child">
제 키는 부모의 절반입니다.
</div>
</div>
div {
width: 250px;
margin-bottom: 5px;
border: 2px solid blue;
}
#taller {
height: 50px;
}
#shorter {
height: 25px;
}
#parent {
height: 100px;
}
#child {
height: 50%;
width: 75%;
}
{{EmbedLiveSample('예제', 'auto', 240)}}
페이지를 확대하거나 글꼴 크기를 늘렸을 때 height 속성을 지정한 요소가 잘리거나 다른 내용을 가리지 않도록 확인하세요.
| Specification | Status | Comment |
|---|---|---|
| {{SpecName('CSS3 Box', '#width-and-height', 'height')}} | {{Spec2('CSS3 Box')}} | Added the max-content, min-content, available, fit-content, border-box, content-box keywords. |
| {{SpecName('CSS3 Transitions', '#animatable-css', 'height')}} | {{Spec2('CSS3 Transitions')}} | Lists height as animatable. |
| {{SpecName('CSS2.1', 'visudet.html#the-height-property', 'height')}} | {{Spec2('CSS2.1')}} | Adds support for the {{cssxref("<length>")}} values and precises on which element it applies to. |
| {{SpecName('CSS1', '#height', 'height')}} | {{Spec2('CSS1')}} | Initial definition. |
| {{SpecName('CSS3 Sizing', '#width-height-keywords', 'width')}} | {{Spec2('CSS3 Sizing')}} | Adds new sizing keywords for width and height. |
{{cssinfo}}
{{Compat("css.properties.height")}}