I am trying to set a background different for each item-icon but it selects every elements instead of the first:
CSS part
.dropdown-item-icon {
width: 50px;
height: 50px;
border-radius: 5px;
&:nth-child(1) {
background-color: red;
}
}
HTML part with items and items icons:
<div class="dropdown">
<a href="">
<div class="dropdown-item">
<div class="dropdown-item-icon"></div>
<div class="dropdown-item-info">
<span class="name">Browse</span>
<p class="description">Challenges created by the community</p>
</div>
</div>
</a>
<a href="">
<div class="dropdown-item">
<div class="dropdown-item-icon"></div>
<div class="dropdown-item-info">
<span class="name">My List</span>
<p class="description">Joined and created challenges</p>
</div>
</div>
</a>
</div>