0

I have the divs below that I'm styling with .thumb and unique identifiers t1, t2, t3, t4, t5, t6, t7, etc.

<div class="thumb t1">   thumb 1   </div>
<div class="thumb t2">   thumb 2   </div>
<div class="thumb t3">   thumb 3   </div>
<div class="thumb t4">   thumb 4   </div>
<div class="thumb t5">   thumb 5   </div>
<div class="thumb t6">   thumb 6   </div>
<div class="thumb t7">   thumb 7   </div>

.t(x) classes can get values from 1 up to 1000 eg. t1, t2, t3....t1000

Is there any way using CSS wildcard * to add a rule only in elements that have classes from t5 and up ?

I could use for example

.t5, .t6, .t6,.t7,.t8, ..., .t1000 {
  position:relative;
  width:100px;
  height:100px;
}

But it's very inconvenience to write all those numbers up to t1000!

Azametzin
  • 5,223
  • 12
  • 28
  • 46
Designer
  • 875
  • 7
  • 26
  • No it isn't duplicated question. The link u provided above adds the wildcard for all elements that have the s(x) identifier. If you read carefully my question you will notice that i need to add the wild card only for elements that have the class t5 and up and on all of them ! – Designer Aug 17 '19 at 12:02
  • I am adding 5 duplicates, but you need to refresh to see them all – Temani Afif Aug 17 '19 at 12:06
  • Thanks @TemaniAfif This code worked for me: .thumb[class^="t"]:nth-child(n+5) { position:absolute!important; } – Designer Aug 17 '19 at 12:28
  • In these cases a dummy div will do the job. `
    put here all your divs
    ` and then use css `.wrapthumbs .thumb { your css of the divs }`
    – bron Aug 17 '19 at 13:15

0 Answers0