K
K
kim1232020-05-12 15:54:35
css
kim123, 2020-05-12 15:54:35

First-child, first-of-type selector not firing?

There is the following markup:

<div class="container">
<div class="card pediatr>
<img src="/img.png>
</div>
<div class="card pediatr>
<img src="/img.png>
</div>
<div class="card nevrolog>
<img src="/img.png>
</div>
<div class="card nevrolog>
<img src="/img.png>
</div>
</div>

How to assign a selector for the first NEVROLOG class? nth-child will not work, you need to assign it to the nevrolog class first in the list.
Tried nevrolog:first-child and nevrolog:first-of-type, didn't work

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
noboxer, 2020-05-12
@kim123

.nevrolog img:first-child { }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question