Satch3000
Satch3000

Reputation: 49384

CSS Target * classes with - and number

I have this CSS which targets all classes containing a - character.

[class*="-"] {
    background-color: rgba(86, 61, 124, 0.15);
    border: 1px solid rgba(86, 61, 124, 0.2);
    padding-bottom: 15px;
    padding-top: 15px;
    margin-bottom: 20px;
}

Is it possible to target all classes with a - character and a number afer it?

Upvotes: 2

Views: 369

Answers (1)

LcSalazar
LcSalazar

Reputation: 16841

I believe the only way possible would be:

[class*="-0"],
[class*="-1"],
[class*="-2"],
[class*="-3"],
[class*="-4"],
[class*="-5"],
[class*="-6"],
[class*="-7"],
[class*="-8"],
[class*="-9"] {
    /*...*/
}

But I don't believe it's a wise selector. You should rethink your approach.

Upvotes: 1

Related Questions