CSS 라인 높이 속성
예시
다른 <div> 요소에 대한 줄 높이를 설정합니다.
div.a {
line-height: normal;
}
div.b {
line-height: 1.6;
}
div.c {
line-height:
80%;
}
div.d {
line-height: 200%;
}
아래에서 더 많은 "직접 사용해 보기" 예를 살펴보세요.
정의 및 사용
속성 은 line-height
선의 높이를 지정합니다.
참고: 음수 값은 허용되지 않습니다.
브라우저 지원
표의 숫자는 속성을 완전히 지원하는 첫 번째 브라우저 버전을 지정합니다.
Property | |||||
---|---|---|---|---|---|
line-height | 1.0 | 4.0 | 1.0 | 1.0 | 7.0 |
CSS 구문
line-height: normal|number|length|initial|inherit;
속성 값
Value | Description | Play it |
---|---|---|
normal | A normal line height. This is default | |
number | A number that will be multiplied with the current font-size to set the line height | |
length | A fixed line height in px, pt, cm, etc. | |
% | A line height in percent of the current font size | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
더 많은 예
예시
다른 <div> 요소에 대해 선 높이를 픽셀 및 센티미터로 설정합니다.
div.a {
line-height: 10px;
}
div.b {
line-height: 30px;
}
div.c {
line-height:
0.5cm;
}
div.d {
line-height: 1cm;
}
예시
줄 높이를 다른 <div> 요소에 대한 숫자로 설정합니다.
div.a {
line-height: 0.5;
}
div.b {
line-height: 1.6;
}
div.c {
line-height: 2;
}
관련 페이지
CSS 튜토리얼: CSS 텍스트
HTML DOM 참조: lineHeight 속성