--- title: background-clip slug: Web/CSS/background-clip tags: - CSS - CSS Background - CSS Property - Reference - 'recipe:css-property' translation_of: Web/CSS/background-clip --- <div>{{CSSRef}}</div> <p><a href="/ko/docs/Web/CSS">CSS</a> <strong><code>background-clip</code></strong> 속성은 요소의 배경이 테두리, 안쪽 여백, 콘텐츠 상자 중 어디까지 차지할 지 지정합니다.</p> <div>{{EmbedInteractiveExample("pages/css/background-clip.html")}}</div> <div class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> and send us a pull request.</div> <p>요소가 {{cssxref("background-image")}} 또는 {{cssxref("background-color")}}를 가지지 않으면, <code>background-clip</code>은 ({{cssxref("border-style")}} 또는 {{cssxref("border-image")}} 등으로 인해) 테두리에 투명하거나 반투명한 부분이 존재하는 경우에만 시각적 차이가 발생합니다. 그렇지 않은 경우 테두리가 차이점을 가립니다.</p> <h2 id="구문">구문</h2> <pre class="brush:css no-line-numbers notranslate">/* 키워드 값 */ background-clip: border-box; background-clip: padding-box; background-clip: content-box; background-clip: text; /* 전역 값 */ background-clip: inherit; background-clip: initial; background-clip: unset; </pre> <h3 class="brush: css" id="값">값</h3> <dl> <dt><code>border-box</code></dt> <dd>배경이 테두리의 바깥 경계까지 차지합니다. (Z축 순서 상 테두리 아래 위치)</dd> <dt><code>padding-box</code></dt> <dd>배경이 안쪽 여백의 바깥 경계까지 차지합니다. 테두리 밑에는 배경을 그리지 않습니다.</dd> <dt><code>content-box</code></dt> <dd>배경을 콘텐츠 상자에 맞춰 그립니다.</dd> <dt><code id="text">text</code> {{experimental_inline}}</dt> <dd>배경을 전경 텍스트 위에만 그립니다.</dd> </dl> <h2 id="형식_정의">형식 정의</h2> <p>{{cssinfo}}</p> <h2 id="형식_구문">형식 구문</h2> {{csssyntax}} <h2 id="예제">예제</h2> <h3 id="HTML">HTML</h3> <pre class="brush: html notranslate"><p class="border-box">The background extends behind the border.</p> <p class="padding-box">The background extends to the inside edge of the border.</p> <p class="content-box">The background extends only to the edge of the content box.</p> <p class="text">The background is clipped to the foreground text.</p> </pre> <h3 id="CSS">CSS</h3> <pre class="brush: css notranslate">p { border: .8em darkviolet; border-style: dotted double; margin: 1em 0; padding: 1.4em; background: linear-gradient(60deg, red, yellow, red, yellow, red); font: 900 1.2em sans-serif; text-decoration: underline; } .border-box { background-clip: border-box; } .padding-box { background-clip: padding-box; } .content-box { background-clip: content-box; } .text { background-clip: text; -webkit-background-clip: text; color: rgba(0,0,0,.2); }</pre> <h3 id="결과">결과</h3> <p>{{EmbedLiveSample('예제', 600, 580)}}</p> <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-clip', 'background-clip')}}</td> <td>{{Spec2('CSS3 Backgrounds')}}</td> <td>Initial definition.</td> </tr> <tr> <td>{{SpecName('CSS4 Backgrounds', '#background-clip', 'background-clip')}}</td> <td>{{Spec2('CSS4 Backgrounds')}}</td> <td>Add <code>text</code> value.</td> </tr> </tbody> </table> <h2 id="브라우저_호환성">브라우저 호환성</h2> <p>{{Compat("css.properties.background-clip")}}</p> <h2 id="같이_보기">같이 보기</h2> <ul> <li>{{cssxref("clip-path")}} 속성은 배경 뿐 아니라 하나의 <u>요소 전체</u>에서 표시할 부분을 지정하는 클리핑 영역을 생성합니다.</li> <li>배경 속성: {{cssxref("background")}}, {{cssxref("background-color")}}, {{cssxref("background-image")}}, {{cssxref("background-origin")}}</li> <li><a href="/ko/docs/Web/CSS/CSS_Box_Model/Introduction_to_the_CSS_box_model">CSS 기본 박스 모델 입문</a></li> </ul>