aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/css/background-clip/index.html
blob: 07d3676b808b1b47d5272933390c37ad369c14bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
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>

<pre class="syntaxbox notranslate">{{csssyntax}}</pre>

<h2 id="예제">예제</h2>

<h3 id="HTML">HTML</h3>

<pre class="brush: html notranslate">&lt;p class="border-box"&gt;The background extends behind the border.&lt;/p&gt;
&lt;p class="padding-box"&gt;The background extends to the inside edge of the border.&lt;/p&gt;
&lt;p class="content-box"&gt;The background extends only to the edge of the content box.&lt;/p&gt;
&lt;p class="text"&gt;The background is clipped to the foreground text.&lt;/p&gt;
</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>