CSS
div{
height: 150;
width: 150;
border: 1px solid black;
margin-bottom: 2px;
}
div:nth-last-of-type(1){
background-color: red;
}
div:nth-last-of-type(2){
background-color: #11ee22;
}
div:nth-last-of-type(3){
background-color: rgb(0, 0, 255);
}
div:nth-last-of-type(4){
background-color: rgba(255, 255, 255, 0.5);
}
HTML
<div></div>
<div></div>
<div></div>
<div></div>
</body>