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
|
---
title: <details>
slug: Web/HTML/Element/details
tags:
- Element
- Elementy interaktywne HTML
- Referencja
- Web
- details
translation_of: Web/HTML/Element/details
---
<div>{{HTMLRef}}</div>
<p><strong><code><font face="Open Sans, arial, x-locale-body, sans-serif">Element </font><details></code></strong> w języku HTML<strong> </strong>jest używany jako widżet (określany często jako spoiler), z którego użytkownik może uzyskać dodatkowych informacji.</p>
<table class="properties">
<tbody>
<tr>
<th scope="row"><a href="/en-US/docs/Web/HTML/Content_categories">Kategoria treści</a></th>
<td><a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">Flow content</a>, root sekcji, treść interaktywna, treść klikalna.</td>
</tr>
<tr>
<th scope="row">Dopuszczalna zawartość</th>
<td>Jeden element {{HTMLElement("summary")}} będący bezpośrednim pierwszym dzieckiem</td>
</tr>
<tr>
<th scope="row">Znaczniki pomijane</th>
<td>{{no_tag_omission}}</td>
</tr>
<tr>
<th scope="row">Dopuszczalni rodzice</th>
<td>Dowolny element <a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">flow content</a>.</td>
</tr>
<tr>
<th scope="row">Rola ARIA</th>
<td>Brak</td>
</tr>
<tr>
<th scope="row">Interfejs w DOM</th>
<td>{{domxref("HTMLDetailsElement")}}</td>
</tr>
</tbody>
</table>
<h2 id="Atrybuty">Atrybuty</h2>
<p>Istnieje możliwość dopisania do elementu <a href="/en-US/docs/Web/HTML/Global_attributes">atrybutów globalnych</a>.</p>
<dl>
<dt>{{htmlattrdef("open")}}</dt>
<dd>Boolean świadczący o tym, czy element ma być otwarty bądź zamknięty po załadowaniu strony. Domyślnie jest to wartość <code>false</code> mówiąca elementowi, aby był zamknięty.</dd>
</dl>
<h2 id="Przykład">Przykład</h2>
<pre class="brush: html"><details>
<summary>Szczypta detali</summary>
<p>Informacje szczegółowe na dany temat.</p>
</details>
<details open>
<summary>Jeszcze wiecej szczegółów</summary>
<p>Tu jest jeszcze wiecej informacji szczegółowych</p>
</details>
</pre>
<h3 id="Rezultat">Rezultat</h3>
<p>{{EmbedLiveSample("Przykład")}}</p>
<div class="note">
<p><strong>Note:</strong> Jeżeli rezultat nie działa u Ciebie poprawnie, zobacz {{anch("kompatybilność z przeglądarkami")}}, aby sprawdzić, czy Twoja przegladarka wspiera ten element.</p>
</div>
<h2 id="Przykład_z_ostylowaniem">Przykład z ostylowaniem</h2>
<p>Zgodnie z najnowszą specyfikacją, Firefox generuje element summary jako <code>display: list-item</code> przez co może być stylowany tak jak elementy listy. Zgodnie ze starszą specyfikacją, Chrome oraz Safari posiadają <code>::-webkit-details-marker</code> pseudo element, który może być stylowany.</p>
<p>Dla cross-browsingu, Firefox ukrywa znacznik summary poprzez <code>summary { display: block }</code>, a z kolei Chrome i Safari poprzez <code>::-webkit-details-marker {display: none;}</code>. Stylowanie może być wtedy odpowiednio przeprowadzone.<br>
Przykład poniżej używa CSSa umozliwiajacego powrót znacznika do punktu wyjścia</p>
<h3 id="HTML">HTML</h3>
<pre class="brush: html"><details>
<summary>Szczypta detali</summary>
<p>Informacje szczegółowe na dany temat.</p>
</details></pre>
<h3 id="CSS">CSS</h3>
<pre class="brush: css">summary {
display: block;
}
summary::-webkit-details-marker {
display: none;
}
summary::before {
content: '\25B6';
padding-right: 0.5em;
}
details[open] > summary::before {
content: '\25BC';
}
</pre>
<h3 id="Rezultat_2">Rezultat</h3>
<p>{{ EmbedLiveSample('Przykład_z_ostylowaniem') }}</p>
<h2 id="Specyfikacja">Specyfikacja</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('HTML WHATWG', 'forms.html#the-details-element', '<details>')}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td> </td>
</tr>
<tr>
<td>{{SpecName('HTML5.1', 'semantics.html#the-details-element', '<details>')}}</td>
<td>{{Spec2('HTML5.1')}}</td>
<td>Początkowa definicja</td>
</tr>
</tbody>
</table>
<h2 id="Kompatybilność_z_przeglądarkami">Kompatybilność z przeglądarkami</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</th>
</tr>
<tr>
<td>Basic support</td>
<td>12</td>
<td><a href="https://developer.microsoft.com/en-us/microsoft-edge/platform/status/detailssummary?filter=f3f0000bf&search=details">In Development</a></td>
<td>{{CompatGeckoDesktop("49.0")}}</td>
<td>{{CompatNo}}</td>
<td>15</td>
<td>6</td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>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>4.0</td>
<td><a href="https://developer.microsoft.com/en-us/microsoft-edge/platform/status/detailssummary?filter=f3f0000bf&search=details">In Development</a></td>
<td>{{CompatGeckoMobile("49.0")}}</td>
<td>{{CompatNo}}</td>
<td>{{CompatNo}}</td>
<td>6.1</td>
</tr>
</tbody>
</table>
</div>
<h2 id="Zobacz_także">Zobacz także</h2>
<ul>
<li>{{HTMLElement("summary")}}</li>
</ul>
|