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
|
---
title: z-index
slug: Web/CSS/z-index
tags:
- CSS
- 'CSS:Dokumentacje'
- Dokumentacje
- Wszystkie_kategorie
translation_of: Web/CSS/z-index
---
<div>{{CSSRef}}</div>
<p>Własność <strong><code>z-index</code></strong> określa kolejność elementów wzdłuż osi z. Kiedy elementy nachodzą na siebie, kolejność osi <code>z</code> decyduje, który element przykrywa inny. Element z większym indeksem <code>z</code> zazwyczaj przykrywa element z mniejszym.</p>
<div>{{EmbedInteractiveExample("pages/css/z-index.html")}}</div>
<ul>
<li>{{ Xref_cssinitial() }}: {{ Cssxref("auto") }}</li>
<li>Stosowana do: {{ Cssxref("position", "elementów pozycjonowanych") }}</li>
<li>{{ Xref_cssinherited() }}: nie</li>
<li>Media: {{ Xref_cssvisual() }}</li>
<li>{{ Xref_csscomputed() }}: jako określona</li>
</ul>
<h2 id="Składnia">Składnia</h2>
<pre class="brush:css no-line-numbers">/* Właściwość wartość */
z-index: auto;
/* wartość jako liczba */
z-index: 0;
z-index: 3;
z-index: 289;
z-index: -1; /* wartość ujemna w celu zmniejszenia priorytetu */
/* globalne wartości */
z-index: inherit;
z-index: initial;
z-index: unset;
</pre>
<p>Wartość <code>z-index</code> jest określona słowem kluczowym <code><a href="#auto">auto</a></code> lub jako <code><a href="#<liczba>"><liczba></a></code>.</p>
<h3 id="Warto.C5.9Bci" name="Warto.C5.9Bci">Wartości</h3>
<dl>
<dt>auto </dt>
<dd>Element jest rysowany w takiej samej kolejności względem osi z jak element z <code>z-index: 0</code>.<em>Nie</em> tworzy nowego kontekstu nakładania.</dd>
<dt><a id="<liczba" name="<liczba>"><code><liczba></code></a></dt>
<dd>Element jest rysowany w podanej kolejności względem osi z. Tworzy również nowy kontekst nakładania, co oznacza, że wszystkie jego elementy potomne również są rysowane z takim samym indeksem z. Oznacza to również, że indeksy z elementów potomnych nie są porównywane do indeksów z elementów na zewnątrz danego elementu.</dd>
</dl>
<h2 id="Przykład">Przykład</h2>
<h3 id="HTML">HTML</h3>
<pre class="brush: html"><div class="dashed-box">Dashed box
<span class="gold-box">Gold box</span>
<span class="green-box">Green box</span>
</div>
</pre>
<h3 id="CSS">CSS</h3>
<pre class="brush: css; highlight:[3,11,19]">.dashed-box {
position: relative;
z-index: 1;
border: dashed;
height: 8em;
margin-bottom: 1em;
margin-top: 2em;
}
.gold-box {
position: absolute;
z-index: 3; /* put .gold-box above .green-box and .dashed-box */
background: gold;
width: 80%;
left: 60px;
top: 3em;
}
.green-box {
position: absolute;
z-index: 2; /* put .green-box above .dashed-box */
background: lightgreen;
width: 20%;
left: 65%;
top: -25px;
height: 7em;
opacity: 0.9;
}
</pre>
<h3 id="Wynik">Wynik</h3>
<p>{{ EmbedLiveSample('Examples', '550', '200', '') }}</p>
<h2 id="Specifikacja">Specifikacja</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 Transitions', '#animatable-css', 'animation behavior for z-index')}}</td>
<td>{{Spec2('CSS3 Transitions')}}</td>
<td>Defines <code>z-index</code> as animatable.</td>
</tr>
<tr>
<td>{{SpecName('CSS2.1', 'visuren.html#z-index', 'z-index')}}</td>
<td>{{Spec2('CSS2.1')}}</td>
<td>Initial definition</td>
</tr>
</tbody>
</table>
<h3 id="Zgodno.C5.9B.C4.87_z_przegl.C4.85dark.C4.85" name="Zgodno.C5.9B.C4.87_z_przegl.C4.85dark.C4.85">Zgodność z przeglądarką</h3>
<p>{{Compat("css.properties.z-index")}}</p>
<h3 id="Zobacz_tak.C5.BCe" name="Zobacz_tak.C5.BCe">Zobacz także</h3>
<p>{{ Cssxref("position") }}</p>
<p>{{ languages( { "en": "en/CSS/z-index", "fr": "fr/CSS/z-index" } ) }}</p>
|