Need help with the pseudo element in navbar

https://codepen.io/Arslan-Akbar/pen/poOMadb here the link to the codepen. I want the pseudo element which appears on hover to have transform scale X of 1 when it has active class on it. Is there any way i can use css selectors for this I tried using something like .nav-items::before.active{ transform:scaleX(1); } it didn't seem to work.
9 Replies
Jochem
Jochem•2y ago
the correct syntax for that is .nav-items.active::before
Malik
Malik•2y ago
the pseudo element is on the .nav-items and i've tried using this syntax. it didn't work.
Jochem
Jochem•2y ago
where is the .before then?
Malik
Malik•2y ago
on the .nav-items class u can see it in the code pen
Jochem
Jochem•2y ago
this works for me:
.nav-items.active-nav-item::before{
transform: scaleX(1);
}
.nav-items.active-nav-item::before{
transform: scaleX(1);
}
Malik
Malik•2y ago
oh mb
Jochem
Jochem•2y ago
.active isn't the class you're using, I assumed it was because that's what you listed in your question
Malik
Malik•2y ago
thank you.
Jochem
Jochem•2y ago
np 🙂
Want results from more Discord servers?
Add your server