last of type

HTML

<!DOCTYPE html>
<html>
<head>
<style> 
p.one:last-of-type(2) {
    background: #ff0000;
}
p:nth-last-of-type(1) {
    background: yellow;
}
</style>
</head>
<body>

<h1>This is a heading</h1>
<p class="one">The first paragraph.</p>
<p class="one">The second paragraph.</p>
<p class="one">The third paragraph.</p>
<p class="one">The fourth paragraph.</p>

<p><b>Note:</b> Internet Explorer 8 and earlier versions do not support the :nth-last-of-type() selector.</p>

</body>
</html>