스타일 lineHeight 속성
예시
<div> 요소의 줄 높이를 설정합니다.
document.getElementById("myDiv").style.lineHeight = "3";
정의 및 사용
lineHeight 속성은 텍스트의 줄 사이의 거리를 설정하거나 반환합니다.
브라우저 지원
Property | |||||
---|---|---|---|---|---|
lineHeight | Yes | Yes | Yes | Yes | Yes |
통사론
lineHeight 속성을 반환합니다.
object.style.lineHeight
lineHeight 속성을 설정합니다.
object.style.lineHeight = "normal|number|length|%|initial|inherit"
속성 값
Value | Description |
---|---|
normal | Normal line height is used. This is default |
number | A number that will be multiplied with the current font size to set the line height |
length | Defines the line height in length units |
% | Defines the line height in % 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 |
기술적 세부 사항
기본값: | 정상 |
---|---|
반환 값: | 텍스트에서 줄 사이의 거리를 나타내는 문자열 |
CSS 버전 | CSS1 |
더 많은 예
예시
<div> 요소의 줄 높이를 반환합니다.
alert(document.getElementById("myDiv").style.lineHeight);
관련 페이지
CSS 튜토리얼: CSS 텍스트
CSS 참조: line-height 속성
❮ 스타일 개체