According to this
:nth-child | CSS-Tricks - CSS-Tricks[
^]
looks like this will work
[href*="blog"]:nth-child(-n+3) {
background-color: red;
}
[Update]
Went to
W3Schools Tryit Editor[
^]
and this seems to work
<!DOCTYPE html>
<html>
<head>
<style>
[href*="blog"]:nth-child(-n+5) {
background-color: red;
}
a { display: block}
</style>
</head>
<body>
<div>
<a href="[someUrl]/blog/1">Text...</a>
<a href="[someUrl]/about">Text...</a>
<a href="[someUrl]/info">Text...</a>
<a href="[someUrl]/blog/2">Text...</a>
<a href="[someUrl]/blog/3">Text...</a>
<a href="[someUrl]/blog/4">Text...</a>
<a href="[someUrl]/contacts">Text...</a>
</div>
</body>
</html>