aboutsummaryrefslogtreecommitdiff
path: root/files/it/web/css/min-width/index.html
blob: 881d345344edeefa263882cdcc4c399d9d032c6d (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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
---
title: min-width
slug: Web/CSS/min-width
tags:
  - CSS
  - Proprietà CSS
  - Riferimento
translation_of: Web/CSS/min-width
---
<div>{{CSSRef}}</div>

<p>La proprietà <a href="/en-US/docs/CSS">CSS</a> <strong><code>min-width</code></strong> imposta la larghezza minima di un elemento.  Questo evita che lo <a href="/it-IT/docs/Web/CSS/used_value">used value</a> della proprietà {{ Cssxref("width") }} diventi più piccolo del valore specificato per <code>min-width</code>.</p>

<pre class="brush:css no-line-numbers">/* &lt;length&gt; value */
min-width: 3.5em;

/* &lt;percentage&gt; value */
min-width: 10%;

/* Keyword values */
min-width: max-content;
min-width: min-content;
min-width: fit-content;
min-width: fill-available;

/* Global values */
min-width: inherit;
min-width: initial;
min-width: unset;
</pre>

<p>La larghezza dell'elemento viene impostata al valore di <code>min-width</code> ogni volta che <code>min-width</code> risulta essere maggiore di {{ Cssxref("max-width") }} or {{Cssxref("width")}}.</p>

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

<h2 id="Sintassi">Sintassi</h2>

<h3 id="Valori">Valori</h3>

<dl>
 <dt>{{cssxref("&lt;length&gt;")}}</dt>
 <dd>La larghezza minima espressa come {{cssxref("&lt;length&gt;")}}. Valori negativi rendono la dichiarazione non valida.</dd>
 <dt> </dt>
 <dt>{{cssxref("&lt;percentage&gt;")}}</dt>
 <dd>La larghezza minima espressa come {{cssxref("&lt;percentage&gt;")}} della larghezza del contenitore. Valori negativi rendono la dichiarazione non valida.</dd>
</dl>

<h4 id="Parole_chiave">Parole chiave</h4>

<dl>
 <dt><code>auto</code></dt>
 <dd>La larghezza di default per oggetti di tipo flex, assegna un valore di default più ragionevole di 0 per gli altri layout.</dd>
 <dt><code>max-content</code> {{ experimental_inline() }}</dt>
 <dd>La larghezza massima preferita (<em>intrinsic</em>).</dd>
 <dt><code>min-content</code> {{ experimental_inline() }}</dt>
 <dd>La larghezza minima preferita (<em>intrinsic</em>).</dd>
 <dt><code>fill-available</code>{{ experimental_inline() }}</dt>
 <dd>La larghezza del blocco contenitore sottratto de: il margine orizzontale, il bordo ed il padding. (Alcuni browsers usano un nome diverso per questa parola chiave, <code>available</code>.)</dd>
 <dt><code>fit-content</code> {{ experimental_inline() }}</dt>
 <dd>Definito come <code>min(max-content, max(min-content, fill-available))</code>.</dd>
</dl>

<h3 id="Sintassi_formale">Sintassi formale</h3>

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

<h2 id="Esempi">Esempi</h2>

<pre class="brush:css;">table { min-width: 75%; }

form { min-width: 0; }
</pre>

<h2 id="Specifiche">Specifiche</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 Sizing', '#width-height-keywords', 'min-width') }}</td>
   <td>{{ Spec2('CSS3 Sizing') }}</td>
   <td>Vengono aggiunte le parole chiave <code>max-content</code>, <code>min-content</code>, <code>fit-content</code> e <code>fill-available</code>. (I draft Box CSS3 e CSS3 Writing Modes definiscono queste keyword, ma vengono sostituiti da questa specifica.<em>)</em></td>
  </tr>
  <tr>
   <td>{{ SpecName('CSS3 Flexbox', '#min-size-auto', 'min-width') }}</td>
   <td>{{ Spec2('CSS3 Flexbox') }}</td>
   <td>Viene aggiunta la keyword <code>auto</code> e viene utilizzata come valore iniziale.</td>
  </tr>
  <tr>
   <td>{{ SpecName('CSS3 Transitions', '#animatable-css', 'min-width') }}</td>
   <td>{{ Spec2('CSS3 Transitions') }}</td>
   <td>Definisce <code>min-width</code> come animabile.</td>
  </tr>
  <tr>
   <td>{{ SpecName('CSS2.1', 'visudet.html#min-max-widths', 'min-width') }}</td>
   <td>{{ Spec2('CSS2.1') }}</td>
   <td>Definizione iniziale.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility" name="Browser_compatibility">Compatibilità dei browser</h2>

<p>{{ CompatibilityTable() }}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Edge</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>1.0</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>1.0 (1.0)</td>
   <td>7.0</td>
   <td>4.0</td>
   <td>2.0.2 (416), buggy before</td>
  </tr>
  <tr>
   <td>si applica a <code>&lt;table&gt;</code> <sup>[1]</sup></td>
   <td>{{ CompatNo() }}</td>
   <td>{{CompatNo}}</td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatNo() }}</td>
  </tr>
  <tr>
   <td><code>max-content</code>, <code>min-content</code>, <code>fit-content</code>, e<code>fill-</code><code>available</code> {{ experimental_inline() }}</td>
   <td>24.0 {{property_prefix("-webkit")}} [3]</td>
   <td>{{CompatNo}}</td>
   <td>{{ CompatGeckoDesktop("1.9") }} {{ property_prefix("-moz") }} [2]</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }}</td>
   <td>{{ CompatNo() }} [3]</td>
  </tr>
  <tr>
   <td><code>auto</code></td>
   <td>21.0 [4]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{ CompatGeckoDesktop("16.0") }} [4]<br>
    Removed in {{ CompatGeckoDesktop("22.0") }}<br>
    Reintroduced in {{CompatGeckoDesktop("34.0")}} with the new behavior defined by the spec.</td>
   <td>{{ CompatNo() }}</td>
   <td>12.10 [6]</td>
   <td>{{ CompatNo() }}</td>
  </tr>
  <tr>
   <td><code>auto</code> as initial value{{obsolete_inline()}}</td>
   <td>21.0</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{ CompatGeckoDesktop("18.0") }}<br>
    Removed in {{ CompatGeckoDesktop("22.0") }}</td>
   <td>{{ CompatNo() }}</td>
   <td>12.10</td>
   <td>{{ CompatNo() }}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Chrome for Android</th>
   <th>Edge</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}[5]</td>
  </tr>
  <tr>
   <td>applies to <code>&lt;table&gt;</code><sup>[1]</sup></td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{CompatNo}}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
  </tr>
  <tr>
   <td><code>max-content</code>, <code>min-content</code>, <code>fit-content</code>, e <code>fill-</code><code>available</code> {{ experimental_inline() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{CompatNo}}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
  </tr>
  <tr>
   <td><code>auto</code></td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
  </tr>
  <tr>
   <td><code>auto</code> come valore iniziale {{obsolete_inline()}}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] CSS 2.1 descrive esplicitamente il comportamento di <code>min-width</code> con {{ HTMLElement("table") }} come indefinito. Quindi qualsiasi tipo di comportamento rispetta CSS2.1; le nuove specifiche CSS potrebbero definire questo comportamento, per cui al momento gli sviluppatori Web non dovrebbero fare affidamento su una specifica implementazione.</p>

<p>[2] Gecko implementa in via sperimentale le definizioni date in CSS3 Basic Box. Questa definisce la keyword <code>available</code> ma non <code>fill-available</code>. Inoltre la definizione di <code>fit-content</code> è più lasca di quella data da CSS3 Intrinsic.</p>

<p>[3] WebKit implementa una proposta precedente, la parola chiave <code>intrinsic</code>.</p>

<p>[4] Queste implementazioni realizzavano un comportamento leggermente più semplice per questa parola chiave: veniva impostata a <code>min-content</code> per gli oggetti di tipo flex, e <code>0</code> per qualsiasi altro elemento.</p>

<p>[5] In alcuni browsers in iOS, un elemento di tipo &lt;button&gt; nella sua configurazione nativa (default) non reagirà all'impostazione del valore min-width. Questo problema dipende dai pulsanti di tipo nativo. Uno &lt;span&gt; collocato dentro ad un pulsante nativo, mostrerà lo stesso problerma, nonostante venga impostato "display:inline-block". Quando altri parametri di stile vengono impostati ed il browser è costretto ad abbandonare il pulsante nativo, l'impostazione di min-width ha effetto.  </p>

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

<ul>
 <li>{{ Cssxref("width") }}, {{ Cssxref("max-width") }}</li>
 <li>Il <a href="/it-IT/docs/Web/CSS/box_model" title="en/CSS/box_model">box model</a>, {{ Cssxref("box-sizing") }}</li>
</ul>