The selector that you seem to be looking for :last-child, rather than last-of-type.
*:last-of-type . , div, p .. , , , .
:last-child , , a . * :last-child , .
div * {
display: inline;
}
div *:after {
content: '';
border-right: 1px solid blue;
}
div :last-child:after {
border-right: none;
}
<div>
<p>Lorem</p>
<a href="#">Ipsum</a>
</div>
Hide result