1

Is there any way to modify the css of nth-child with after pseudo?

 $(".product-block:nth-child(-n+6):after").css("background-color", "#" + col6);

The css of the element results in the black tab as you can see below (to the first six items), I'm making a theme switcher which is why I'm needing to do this.

Result of the element above

john
  • 399
  • 1
  • 3
  • 9

1 Answers1

0

I think your best bet would be to use .next();

$(".product-block:nth-child(-n+6)").next().css("background-color", "#" + col6);

Zaichik
  • 308
  • 1
  • 7