Please explain why in some cases pseudo-classes in conjunction with CSS-selectors work and sometimes not.
The Code (https://jsfiddle.net/aspanoz/m1sg4496/):
div.wrapper {
margin-bottom: 10px
}
div[class*="myclass"]:not(:first-of-type) {
color: green
}
div[class*="myclass"]:first-of-type {
color: red
}
<div class="wrapper">
<div class="myclass">This text should appear red.</div>
<div class="myclass">This text should appear green.</div>
<div class="myclass">This text should appear green.</div>
<div>this :first-of-type working as exepted</div>
</div>
<div class="wrapper">
<div>but this :first-of-type fail</div>
<div class="myclass">This text should appear red.</div>
<div class="myclass">This text should appear green.</div>
<div class="myclass">This text should appear green.</div>
</div>