Pokepoke
Pokepoke

Reputation: 41

CSS pseudo content selector

I'm trying to determine the style of a div by going by what is in it. If the content is '0', it should have color: red, and if not, fall back to the usual color.

I've found there used to be :contains(value), but that doesn't exist anymore. Is there any replacement I can use for this in css?

Thanks in advance.

Upvotes: 1

Views: 113

Answers (1)

BoltClock
BoltClock

Reputation: 724592

No, there isn't. If CSS was going to have a content selector, it would have kept :contains().

For what it's worth, jQuery implements :contains(), so if you're using it already you can apply styles with it instead.

Upvotes: 4

Related Questions