Source Code: (back to article)
<!DOCTYPE html>
<html>
<head>
<title>Заголовок документа</title>
<style>
p:nth-last-child(odd) {
background: #1c87c9;
color:#eee;
}
p:nth-last-child(even) {
background: #666;
color:#eee;
}
</style>
</head>
<body>
<h2>Пример селектора :nth-last-child</h2>
<p>Параграф 1</p>
<p>Параграф 2</p>
<p>Параграф 3</p>
</body>
</html>