aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/css/gap/index.html
blob: ae546d2393ad22432a0426ac9c8d08235b46b3b4 (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
---
title: gap (grid-gap)
slug: Web/CSS/gap
tags:
  - CSS
  - CSS Flexible Boxes
  - CSS Grid
  - CSS Multi-column Layout
  - CSS Property
  - Reference
translation_of: Web/CSS/gap
---
<div>{{CSSRef}}</div>

<p><span class="seoSummary"><a href="/ko/docs/Web/CSS">CSS</a> <strong><code>gap</code></strong> 속성은 행과 열 사이의 간격(거터)을 설정합니다. {{CSSxRef("row-gap")}}{{CSSxRef("column-gap")}}<a href="/ko/docs/Web/CSS/Shorthand_properties">단축 속성</a>입니다.</span></p>

<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>

<div>{{EmbedInteractiveExample("pages/css/gap.html")}}</div>

<h2 id="구문">구문</h2>

<pre class="brush: css; no-line-numbers">/* 단일 &lt;length&gt; 값 */
gap: 20px;
gap: 1em;
gap: 3vmin;
gap: 0.5cm;

/* 단일 &lt;percentage&gt; 값 */
gap: 16%;
gap: 100%;

/* 이중 &lt;length&gt; 값 */
gap: 20px 10px;
gap: 1em 0.5em;
gap: 3vmin 2vmax;
gap: 0.5cm 2mm;

/* 이중 또는 혼합 &lt;percentage&gt; 값 */
gap: 16% 100%;
gap: 21px 82%;

/* calc() 값 */
gap: calc(10% + 20px);
gap: calc(20px + 10%) calc(10% - 5px);

/* 전역 값 */
gap: inherit;
gap: initial;
gap: unset;
</pre>

<p><code>gap</code><code>&lt;'row-gap'&gt;</code> 값을 사용해 지정하며, 선택적으로 <code>&lt;'column-gap'&gt;</code>을 추가할 수 있습니다. <code>&lt;'column-gap'&gt;</code>을 생략한 경우 <code>&lt;'row-gap'&gt;</code>과 동일한 값을 사용합니다.</p>

<p><code>&lt;'row-gap'&gt;</code><code>&lt;'column-gap'&gt;</code>은 각각 <code>&lt;length&gt;</code> 또는 <code>&lt;percentage&gt;</code>를 사용해 지정합니다.</p>

<h3 id="값"></h3>

<dl>
 <dt>{{CSSxRef("&lt;length&gt;")}}</dt>
 <dd>그리드 선을 분할하는 간격의 너비.</dd>
 <dt>{{CSSxRef("&lt;percentage&gt;")}}</dt>
 <dd>그리드 선을 분할하는 간격의 너비. 요소 크기에 상대적입니다.</dd>
</dl>

<h3 id="formal_definition">형식 정의</h3>
{{cssinfo}}

<h3 id="형식_구문">형식 구문</h3>

{{CSSSyntax}}

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

<h3 id="플렉스_레이아웃">플렉스 레이아웃</h3>

<h4 id="HTML">HTML</h4>

<pre class="brush: html;">&lt;div id="flexbox"&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>

<h4 id="CSS">CSS</h4>

<pre class="brush: css; highlight[5]">#flexbox {
  display: flex;
  flex-wrap: wrap;
  width: 300px;
  gap: 20px 5px;
}

#flexbox &gt; div {
  border: 1px solid green;
  background-color: lime;
  flex: 1 1 auto;
  width: 100px;
  height: 50px;

}
</pre>

<h4 id="결과">결과</h4>

<p>{{EmbedLiveSample("플렉스_레이아웃", "auto", "120px")}}</p>

<h3 id="그리드_레이아웃">그리드 레이아웃</h3>

<h4 id="HTML_2">HTML</h4>

<pre class="brush: html;">&lt;div id="grid"&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
&lt;/div&gt;</pre>

<h4 id="CSS_2">CSS</h4>

<div class="hidden">
<pre class="brush: css">#grid {
  grid-gap: 20px 5px;
}
</pre>
</div>

<pre class="brush: css; highlight[5]">#grid {
  display: grid;
  height: 200px;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  gap: 20px 5px;
}

#grid &gt; div {
  border: 1px solid green;
  background-color: lime;
}
</pre>

<h4 id="결과_2">결과</h4>

<p>{{EmbedLiveSample("그리드_레이아웃", "auto", "120px")}}</p>

<h3 id="다열_레이아웃">다열 레이아웃</h3>

<h4 id="HTML_3">HTML</h4>

<pre class="brush: html;">&lt;p class="content-box"&gt;
  This is some multi-column text with a 40px column
  gap created with the CSS &lt;code&gt;gap&lt;/code&gt; property.
  Don't you think that's fun and exciting? I sure do!
&lt;/p&gt;
</pre>

<h4 id="CSS_3">CSS</h4>

<pre class="brush: css; highlight[3]">.content-box {
  column-count: 3;
  gap: 40px;
}
</pre>

<h4 id="결과_3">결과</h4>

<p>{{EmbedLiveSample("다열_레이아웃", "auto", "120px")}}</p>

<h2 id="명세">명세</h2>
{{Specifications("css.properties.gap.grid_context")}}


<h2 id="브라우저_호환성">브라우저 호환성</h2>
{{Compat}}


<h2 id="같이_보기">같이 보기</h2>

<ul>
 <li>관련 CSS 속성: {{CSSxRef("row-gap")}}, {{CSSxRef("column-gap")}}</li>
 <li>그리드 레이아웃 안내서: <em><a href="/ko/docs/Web/CSS/CSS_Grid_Layout/Basic_Concepts_of_Grid_Layout#Gutters">Basic concepts of grid layout - Gutters</a></em></li>
</ul>