스타일 verticalAlign 속성
예시
표에 있는 일부 텍스트의 수직 정렬을 "아래"로 설정:
document.getElementById("myTd").style.verticalAlign = "bottom";
정의 및 사용
verticalAlign 속성은 요소에 있는 내용의 수직 정렬을 설정하거나 반환합니다.
브라우저 지원
Property | |||||
---|---|---|---|---|---|
verticalAlign | Yes | Yes | Yes | Yes | Yes |
통사론
verticalAlign 속성을 반환합니다.
object.style.verticalAlign
verticalAlign 속성을 설정합니다.
object.style.verticalAlign = value
속성 값
Value | Description |
---|---|
length | Raises or lower an element by the specified length. Negative values are allowed |
% | Raises or lower an element in a percent of the "line-height" property. Negative values are allowed |
baseline | Align the baseline of the element with the baseline of the parent element. This is default |
sub | Aligns the element as it was subscript |
super | Aligns the element as it was superscript |
top | The top of the element is aligned with the top of the tallest element on the line |
text-top | The top of the element is aligned with the top of the parent element's font |
middle | The element is placed in the middle of the parent element |
bottom | The bottom of the element is aligned with the lowest element on the line |
text-bottom | The bottom of the element is aligned with the bottom of the parent element's font |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
기술적 세부 사항
기본값: | 기준선 |
---|---|
반환 값: | 요소에 있는 콘텐츠의 수직 정렬을 나타내는 문자열 |
CSS 버전 | CSS1 |
더 많은 예
예시
<td> 요소의 수직 정렬을 반환합니다.
alert(document.getElementById("myTd").style.verticalAlign);
관련 페이지
CSS 튜토리얼: CSS 텍스트
CSS 참조: vertical-align 속성
❮ 스타일 개체