Typically, you can only orient an element, the value of a named attribute in it, or the name of an attribute in an element. So, I would say the answer may be ... no? (limited by my own knowledge)
It is said ..
Is it possible to insert an empty <li> before each element that you want to target?
If so, you can easily select the following items:
ul li { color: red } li:empty { display: none } li:empty + li { color: green }
<ul> <li></li> <li class="a">1</li> <li class="a">2</li> <li class="a">3</li> <li></li> <li class="b">4</li> <li class="b">5</li> <li class="b">6</li> </ul>
user7234396
source share