blob: 3cff865582b61a6a51bfea5f1ff4f307d85deb53 (
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
|
---
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 class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
<p>{{Compat("css.properties.background-origin")}}</p>
<h2 id="같이_보기">같이 보기</h2>
<ul>
<li>{{cssxref("background-clip")}}</li>
</ul>
|