Conditional formatting of HTML+CSS?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
12 views
Is there a way to do conditional formatting like in Excel. I.e. to the properties of an element depended on its content. Preferably without JS.
For example, the color numbers hung from its value.
Well, let's say
0 white
1 red
2 green and so on
by | 12 views

1 Answer

0 like 0 dislike
https://jsfiddle.net/9aqchcsf/1/
\r\r

[data-number]::before { content: attr(data-number); } [data-number="1"] { color: red; } [data-number="2"] { color: blue; } [data-number="3"] { color: green; }
by
110,608 questions
257,186 answers
0 comments
35,431 users