-1

Is it possible to hide an element depending on its inner content ?

ex:

<div class="score">No score</div>

hide that div (in pure CSS) when inner Text is "No score"

yarek
  • 11,278
  • 30
  • 120
  • 219

1 Answers1

2

As far as i'm concerned you can't select the inner text of an html tag.

What you can do is using html data-attributes

<div data-score="No score"></div>

And then

[data-score="No score"] {
    color:red;
}

One css function that can interest you is the attr function.

Matteo
  • 158
  • 6