P
P
Pavel Zaitsev2021-08-24 21:04:08
css
Pavel Zaitsev, 2021-08-24 21:04:08

What's the best pseudo class to use?

I made a page layout. I want the inscriptions "NEW!" (which are on the right) were green in the first two posts and then red using pseudo-classes. I have them either all green or all red. Please help, what is wrong?

https://jsfiddle.net/kqc1gr7b/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ankhena, 2021-08-24
@OmniaNightmare

article:nth-child(-n+2) .new {
  color: red;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question