Level 88
The problem is that the card itself doesn't have a second or third child. The col-md-3 does have second and third child.
Check this out: https://codepen.io/bobbybouwmann/pen/rNxKKqB
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
He I am exploring the features of CSS 3 and I walked into some trouble:
Now I want to add a :hover effect where the element gets a slightly lighter color than its' default value. So the odd and dark-blue tiles get a slightly lighter color and the even and light-blue tiles get an even lighter blue color when this happens.
For a #SERVICE I have made this CSS:
#services:hover .card:nth-child(1) {
background-color: #ff0084;
}
#services:hover .card:nth-child(2) {
background-color: #21ff19;
}
#services:hover .card:nth-child(3) {
background-color: #fffa08;
}
#services:hover .card:nth-child(4) {
background-color: #1a1cff;
}
HTML
<section id="services" class="text-white">
<div class="row">
<div class="col-md-3">
<div class="card">
<div class="pt-5 pb-3 text-center">
<i class="far fa-lightbulb fa-4x"></i>
</div>
<p class="text-center">Studio Design</p>
</div>
</div>
//.....//
</div>
</section>
The problem is that the card itself doesn't have a second or third child. The col-md-3 does have second and third child.
Check this out: https://codepen.io/bobbybouwmann/pen/rNxKKqB
Please or to participate in this conversation.