스타일 하단 속성
예시
<button> 요소의 맨 아래 위치를 설정합니다.
document.getElementById("myBtn").style.bottom = "100px";
정의 및 사용
bottom 속성은 배치된 요소의 아래쪽 위치를 설정하거나 반환합니다.
이 속성은 패딩, 스크롤바, 테두리 및 여백을 포함한 요소의 맨 아래 위치를 지정합니다.
팁: 위치 지정 요소는 위치 속성이 상대, 절대 또는 고정으로 설정된 요소입니다.
팁: 배치된 요소의 상단 위치를 설정하거나 반환하려면 top 속성을 사용하십시오.
브라우저 지원
Property | |||||
---|---|---|---|---|---|
bottom | Yes | Yes | Yes | Yes | Yes |
통사론
하단 속성을 반환합니다.
object.style.bottom
하단 속성을 설정합니다.
object.style.bottom = "auto|length|%|initial|inherit"
속성 값
Value | Description |
---|---|
auto | Lets the browser set the bottom position. This is default |
length | Defines the bottom position in length units. Negative values are allowed |
% | Sets the bottom position in % of the height of the parent element |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
기술적 세부 사항
기본값: | 자동 |
---|---|
반환 값: | 위치 지정 요소의 맨 아래 위치를 나타내는 문자열 |
CSS 버전 | CSS2 |
더 많은 예
예시
<div> 요소의 맨 아래 위치를 설정합니다.
document.getElementById("myDiv").style.bottom = "10px";
예시
음수 값 사용 - <div> 요소의 맨 아래 위치 설정:
document.getElementById("myDiv").style.bottom = "-100px";
예시
<div> 요소의 맨 아래 위치를 반환합니다.
alert(document.getElementById("myDiv").style.bottom);
관련 페이지
CSS 튜토리얼: CSS 포지셔닝
CSS 참조: 하단 속성
❮ 스타일 개체