<!DOCTYPE html>
<html>
<head>
<title>CSS :nth-last-child(n) Selector</title>
<style type="text/css">
li:nth-last-child(3n+1) {
background:#ff0000;
}
</style>
</head>
<body>
<ul>
<li>first item</li>
<li>second item</li>
<li>third item</li>
<li>forth item</li>
<li>fifth item</li>
</ul>
</body>
</html>