aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/css/flex-shrink/index.html
blob: 14a6f5427f2338985b4fe9f5524914ae1ca02abe (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
---
title: flex-shrink
slug: Web/CSS/flex-shrink
tags:
  - CSS
  - CSS Flexible Boxes
  - CSS Property
  - NeedsContent
  - Reference
translation_of: Web/CSS/flex-shrink
---
<div>{{CSSRef}}</div>

<p><strong><code>flex-shrink</code></strong> <a href="/en-US/docs/CSS" title="CSS">CSS</a> property는 <code>flex-item</code> 요소의 <code>flex-shrink</code> 값을 설정하는 속성입니다. 만약 <code>flex-item</code> 요소의 크기가 <code>flex-container</code> 요소의 크기보다 클 때 flex-shrink 속성을 사용하는데, 설정된 숫자값에 따라 <code>flex-container</code> 요소 내부에서 <code>flex-item</code> 요소의 크기가 <strong>축소</strong>됩니다.</p>

<div>{{EmbedInteractiveExample("pages/css/flex-shrink.html")}}</div>



<h2 id="Syntax">Syntax</h2>

<pre class="brush:css no-line-numbers">/* &lt;number&gt; values */
flex-shrink: 2;
flex-shrink: 0.6;

/* Global values */
flex-shrink: inherit;
flex-shrink: initial;
flex-shrink: unset;
</pre>

<p>The <code>flex-shrink</code> property is specified as a single <code><a href="#&lt;number>">&lt;number&gt;</a></code>.</p>

<h3 id="Values">Values</h3>

<dl>
 <dt><a id="&lt;number>" name="&lt;number>"><code>&lt;number&gt;</code></a></dt>
 <dd>관련 링크를 참고하세요{{cssxref("&lt;number&gt;")}}. 단, 음수값은 허용되지 않습니다.</dd>
</dl>

<h3 id="Formal_syntax">Formal syntax</h3>

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

<h2 id="Example">Example</h2>

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

<div id="Live_Sample">
<pre class="brush: html">&lt;p&gt;The width of content is 500px; the flex-basis of the flex items is 120px.&lt;/p&gt;
&lt;p&gt;A, B, C have flex-shrink:1 set. D and E have flex-shrink:2 set&lt;/p&gt;
&lt;p&gt;The width of D and E is less than the others.&lt;/p&gt;
&lt;div id="content"&gt;
  &lt;div class="box" style="background-color:red;"&gt;A&lt;/div&gt;
  &lt;div class="box" style="background-color:lightblue;"&gt;B&lt;/div&gt;
  &lt;div class="box" style="background-color:yellow;"&gt;C&lt;/div&gt;
  &lt;div class="box1" style="background-color:brown;"&gt;D&lt;/div&gt;
  &lt;div class="box1" style="background-color:lightgreen;"&gt;E&lt;/div&gt;
&lt;/div&gt;
</pre>

<h3 id="CSS">CSS</h3>

<pre class="brush: css">#content {
  display: flex;
  width: 500px;
}

#content div {
  flex-basis: 120px;
  border: 3px solid rgba(0,0,0,.2);
}

.box {
  flex-shrink: 1;
}

.box1 {
  flex-shrink: 2;
}
</pre>
</div>

<h3 id="Result">Result</h3>

<p>{{ EmbedLiveSample('Example', 500, 300) }}</p>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th>Specification</th>
   <th>Status</th>
   <th>Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{ SpecName('CSS3 Flexbox', '#flex-shrink', 'flex-shrink') }}</td>
   <td>{{ Spec2('CSS3 Flexbox') }}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<p>{{cssinfo}}</p>

<h2 id="Browser_compatibility">Browser compatibility</h2>



<p>{{Compat("css.properties.flex-shrink")}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>CSS Flexbox Guide: <em><a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox">Basic Concepts of Flexbox</a></em></li>
 <li>CSS Flexbox Guide: <em><a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Controlling_Ratios_of_Flex_Items_Along_the_Main_Ax">Controlling Ratios of flex items along the main axis</a></em></li>
</ul>

<p><nobr></nobr></p>