aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/css/_colon_last-child/index.html
blob: 195d6e9a13a5d42f7bb3ac242df9a899aa20af44 (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
---
title: ':last-child'
slug: 'Web/CSS/:last-child'
translation_of: 'Web/CSS/:last-child'
---
<div>{{CSSRef}}</div>

<h2 id="Описание">Описание</h2>

<p>CSS <a href="/ru/docs/Web/CSS/Pseudo-classes">псевдокласс</a> <code>:last-child</code> находит любой элемент, являющийся последним в его родителе.</p>

<h2 id="Синтаксис">Синтаксис</h2>

<pre class="syntaxbox">element:last-child { <em>style properties</em> }</pre>

<h2 id="Пример">Пример</h2>

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

<pre class="brush: html">&lt;ul&gt;
  &lt;li&gt;Этот элемент не лаймовый.&lt;/li&gt;
  &lt;li&gt;И этот тоже.&lt;/li&gt;
  &lt;li&gt;А этот да! :)&lt;/li&gt;
&lt;/ul&gt;</pre>

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

<pre class="brush: css">li:last-child {
  background-color: lime;
}</pre>

<p>{{EmbedLiveSample('Пример', '100%', 100)}}</p>

<h2 id="Спецификации">Спецификации</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Спецификации</th>
   <th scope="col">Статус</th>
   <th scope="col">Комментарий</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS4 Selectors', '#last-child', ':last-child')}}</td>
   <td>{{Spec2('CSS4 Selectors')}}</td>
   <td>Без изменений</td>
  </tr>
  <tr>
   <td>{{SpecName('CSS3 Selectors', '#last-child', ':last-child')}}</td>
   <td>{{Spec2('CSS3 Selectors')}}</td>
   <td>Изначальное определение</td>
  </tr>
 </tbody>
</table>

<h2 id="Поддержка_браузерами">Поддержка браузерами</h2>

<p>{{Compat("css.selectors.last-child")}}</p>

<h2 id="Смотрите_также">Смотрите также</h2>

<ul>
 <li>{{cssxref(":first-child")}}</li>
 <li>{{cssxref(":nth-child")}}</li>
 <li>{{cssxref(":last-of-type")}}</li>
</ul>