스타일 backgroundOrigin 속성
예시
콘텐츠 상자를 기준으로 배경 이미지를 배치합니다.
document.getElementById("myDIV").style.backgroundOrigin = "content-box";
정의 및 사용
backgroundOrigin 속성은 background-position 속성이 상대적인 대상을 설정하거나 반환합니다.
참고: 배경 이미지의 background-attachment 속성이 "고정"인 경우 이 속성은 효과가 없습니다.
브라우저 지원
표의 숫자는 속성을 완전히 지원하는 첫 번째 브라우저 버전을 지정합니다.
Property | |||||
---|---|---|---|---|---|
backgroundOrigin | 4.0 | 9.0 | 4.0 | 3.0 | 10.5 |
통사론
backgroundOrigin 속성을 반환합니다.
object.style.backgroundOrigin
backgroundOrigin 속성을 설정합니다.
object.style.backgroundOrigin = "padding-box|border-box|content-box|initial|inherit"
속성 값
Value | Description |
---|---|
padding-box | Default value. The background image is positioned relative to the padding box |
border-box | The background image is positioned relative to the border box |
content-box | The background image is positioned relative to the content box |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
기술적 세부 사항
기본값: | 패딩 박스 |
---|---|
반환 값: | 요소의 background-origin 속성을 나타내는 String |
CSS 버전 | CSS3 |
관련 페이지
CSS 참조: background-origin 속성