--- title: background-origin slug: Web/CSS/background-origin tags: - CSS - CSS Background - CSS Property - Reference - 'recipe:css-property' translation_of: Web/CSS/background-origin --- <div>{{CSSRef}}</div> <p><a href="/ko/docs/Web/CSS">CSS</a> <strong><code>background-origin</code></strong> 속성은 배경의 원점을 테두리 시작점, 테두리 내부, 안쪽 여백 내부 중 하나로 지정합니다.</p> <div>{{EmbedInteractiveExample("pages/css/background-origin.html")}}</div> <p>{{cssxref("background-attachment")}}가 <code>fixed</code>인 경우 <code>background-origin</code>은 무시됩니다.</p> <h2 id="구문">구문</h2> <pre class="brush: css no-line-numbers notranslate">/* 키워드 값 */ background-origin: border-box; background-origin: padding-box; background-origin: content-box; /* 전역 값 */ background-origin: inherit; background-origin: initial; background-origin: unset; </pre> <p><code>background-origin</code> 속성은 다음 목록의 키워드 중 하나를 선택해 지정할 수 있습니다.</p> <h3 id="값">값</h3> <dl> <dt><code>border-box</code></dt> <dd>배경을 테두리 박스에 상대적으로 배치합니다.</dd> <dt><code>padding-box</code></dt> <dd>배경을 안쪽 여백 박스에 상대적으로 배치합니다.</dd> <dt><code>content-box</code></dt> <dd>배경을 콘텐츠 박스에 상대적으로 배치합니다.</dd> </dl> <h2 id="형식_정의">형식 정의</h2> <p>{{cssinfo}}</p> <h2 id="형식_구문">형식 구문</h2> {{csssyntax}} <h2 id="예제">예제</h2> <h3 id="배경_원점_설정하기">배경 원점 설정하기</h3> <pre class="brush:css; highlight:[6]; notranslate">.example { border: 10px double; padding: 10px; background: url('image.jpg'); background-position: center left; background-origin: content-box; } </pre> <pre class="brush:css; highlight:[6]; notranslate">#example2 { border: 4px solid black; padding: 10px; background: url('image.gif'); background-repeat: no-repeat; background-origin: border-box; } </pre> <pre class="brush:css; highlight:[4]; notranslate">div { background-image: url('logo.jpg'), url('mainback.png'); /* Applies two images to the background */ background-position: top right, 0px 0px; background-origin: content-box, padding-box; }</pre> <h2 id="명세">명세</h2> <table class="standard-table"> <thead> <tr> <th scope="col">Specification</th> <th scope="col">Status</th> <th scope="col">Comment</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('CSS3 Backgrounds', '#the-background-origin', 'background-origin')}}</td> <td>{{Spec2('CSS3 Backgrounds')}}</td> <td>Initial definition.</td> </tr> </tbody> </table> <h2 id="브라우저_호환성">브라우저 호환성</h2> <p>{{Compat("css.properties.background-origin")}}</p> <h2 id="같이_보기">같이 보기</h2> <ul> <li>{{cssxref("background-clip")}}</li> </ul>