aboutsummaryrefslogtreecommitdiff
path: root/files/it/web/css/background-attachment/index.html
blob: 2f4615c65c5eafd887eef643be58b800204ad2d4 (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
---
title: background-attachment
slug: Web/CSS/background-attachment
translation_of: Web/CSS/background-attachment
---
<p>&lt;&lt; <a href="it/Guida_di_riferimento_ai_CSS">Guida di riferimento ai CSS</a></p>

<h3 id="Sommario" name="Sommario">Sommario</h3>

<p>Se è stata specificata una <code><a href="it/CSS/background-image">background-image</a></code>, la proprietà <code>background-attachment</code> determina se l'immagine è fissa o può scorrere all'interno dell'elemento al quale è assegnata.</p>

<ul>
 <li>Valore iniziale: scroll</li>
 <li>Si applica a: tutti gli elementi</li>
 <li>Eredità: no</li>
 <li>valori percentuali: non applicabile</li>
 <li>Media: <code><a href="it/CSS/Media/Visual">visual</a></code></li>
 <li>Valore calcolato: come specificato</li>
</ul>

<h3 id="Sintassi" name="Sintassi">Sintassi</h3>

<pre class="eval">background-attachment: scroll | fixed | inherit
</pre>

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

<dl>
 <dt>scroll </dt>
 <dd>Se <code>scroll</code> viene specificato, l'immagine di sfondo può scorrere all'interno dell'elemento al quale è assegnata</dd>
 <dt>fixed </dt>
 <dd>Se <code>fixed</code> viene specificato, l'immagine di sfondo è fissa nell'elemento che la contiene</dd>
</dl>

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

<h3 id="Simple_example">Simple example</h3>

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

<pre class="brush:css; highlight:[3];">p {
  background-image: url("https://mdn.mozillademos.org/files/12057/starsolid.gif");
  background-attachment: fixed;
}
</pre>

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

<pre class="brush: html">&lt;p&gt;
  There were doors all round the hall, but they were all locked; and when
  Alice had been all the way down one side and up the other, trying every
  door, she walked sadly down the middle, wondering how she was ever to
  get out again.
&lt;/p&gt;</pre>

<h4 id="Result">Result</h4>

<p>{{EmbedLiveSample("Simple_example")}}</p>

<h3 id="Multiple_background_image_support">Multiple background image support</h3>

<p>This property supports multiple background images. You can specify a different <code>&lt;attachment&gt;</code> for each background, separated by commas. Each image is matched with the corresponding attachment type, from first specified to last.</p>

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

<pre class="brush:css; highlight:[3];">p {
  background-image: url("https://mdn.mozillademos.org/files/12057/starsolid.gif"), url("https://mdn.mozillademos.org/files/12059/startransparent.gif");
  background-attachment: fixed, scroll;
  background-repeat: no-repeat, repeat-y;
}</pre>

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

<pre class="brush: html">&lt;p&gt;
  There were doors all round the hall, but they were all locked; and when
  Alice had been all the way down one side and up the other, trying every
  door, she walked sadly down the middle, wondering how she was ever to
  get out again.

  Suddenly she came upon a little three-legged table, all made of solid
  glass; there was nothing on it except a tiny golden key, and Alice's
  first thought was that it might belong to one of the doors of the hall;
  but, alas! either the locks were too large, or the key was too small,
  but at any rate it would not open any of them. However, on the second
  time round, she came upon a low curtain she had not noticed before, and
  behind it was a little door about fifteen inches high: she tried the
  little golden key in the lock, and to her great delight it fitted!
&lt;/p&gt;</pre>

<h4 id="Result_2">Result</h4>

<p>{{EmbedLiveSample("Multiple_background_image_support")}}</p>

<h3 id="Specifiche" name="Specifiche">Specifiche</h3>

<ul>
 <li><a class="external" href="http://www.w3.org/TR/CSS1#background-attachment">CSS 1</a></li>
 <li><a class="external" href="http://www.w3.org/TR/CSS21/colors.html#propdef-background-attachment">CSS 2.1</a></li>
 <li><a class="external" href="http://www.w3.org/TR/2005/WD-css3-background-20050216/#background-attachment">CSS 3</a></li>
</ul>

<h3 id="Compatibilit.C3.A0_con_i_browser" name="Compatibilit.C3.A0_con_i_browser">Compatibilità con i browser</h3>

<table class="standard-table">
 <tbody>
  <tr>
   <th>Browser</th>
   <th>Versione minima</th>
  </tr>
  <tr>
   <td>Internet Explorer</td>
   <td>4</td>
  </tr>
  <tr>
   <td>Firefox</td>
   <td>1</td>
  </tr>
  <tr>
   <td>Netscape</td>
   <td>6</td>
  </tr>
  <tr>
   <td>Opera</td>
   <td>3.5</td>
  </tr>
 </tbody>
</table>

<h3 id="Si_veda_anche" name="Si_veda_anche">Si veda anche</h3>

<p><code><a href="it/CSS/background">background</a></code>, <code><a href="it/CSS/background-color">background-color</a></code>, <code><a href="it/CSS/background-image">background-image</a></code>, <code><a href="it/CSS/background-position">background-position</a></code>, <code><a href="it/CSS/background-repeat">background-repeat</a></code></p>

<div class="noinclude"> </div>

<p>{{ languages( { "en": "en/CSS/background-attachment", "fr": "fr/CSS/background-attachment", "pl": "pl/CSS/background-attachment" } ) }}</p>