Perhaps applying for all, and negating for all but first will fit your case
.lineB{color:red}
.lineB ~ .lineB{color:inherit}
<div id="main">
<div class="lineA">I'm LineA</div>
<div class="lineA">I'm LineA</div>
<div class="lineB">I'm the first LineB</div>
<div class="lineB">I'm LineB</div>
<div class="lineB">I'm LineB</div>
<div class="lineA">I'm LineA</div>
</div>
In your specific example you could just use #main .lineB span{display:none}
since you only have a span inside the first.
The :first-of-type
works on the element type (the tag) so it would match only an element that is the first of its type (tag) under the parent. Since all of your elements are div
the :first-of-type
matches the first div.
Extending my initial answer to handle this scenario you can do
#main .lineB span{display:none}
#main .lineB ~ .lineB span{display:initial}
<div id="main">
<div class="lineA">I'm LineA</div>
<div class="lineA">I'm LineA</div>
<div class="lineB">I'm the first <span>hide me</span> LineB</div>
<div class="lineB">I'm LineB <span> show me</span></div>
<div class="lineB">I'm LineB</div>
<div class="lineA">I'm LineA</div>
</div>