I wonder if the following is possible with CSS:
HTML-Code:
<span class="funny-elem" data-mystate="127">Hello World</span>
<span class="funny-elem" data-mystate="69">Hello Bird</span>
<span class="funny-elem" data-mystate="1337">Hello Nerd</span>
<span class="funny-elem" data-mystate="14">Hello What</span>
<span class="funny-elem" data-mystate="0">Hello Else</span>
...
CSS-Code:
.funny-elem[data-mystate=">50"] {
color:#0f0;
}
.funny-elem[data-mystate="<50"] {
color:#f00;
}
The above CSS code will not work of course as the "greater than" and "lesser than" sign are interpreted as attribute value here.
However do you know a way to select all elements with an numerical attribute value greater than or lesser than a certain number?