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