:last-child:first-letter:hover
The two photos I have attached are my issue I am trying to target the first letter of the last child when hovering to change the first letter to a different colour so you can see it.
So this is what i have tried:
It won't work because this code overrides it, I could change it here but I don't want to change the colour of all the other first letters in the navbar.
Please help me surely there is a way?
16 Replies
@cubiq If you would please my man 😄
@Stroudy please don't @ people to draw them into your post
if people want to help, they'll help in their own time
im fine with that
if you want a better chance at getting people to help, share your code in a codepen
how about you apply the styles when :not() hover?
whatever the styles are, in that big hunk of text
it would really help to create that codepen but my approach would be creating local variables and then on hover changing the variable colors:
you get the point.. this way you have just one place where you apply the actual color on that selector..
I do apologise if this is against the rules i only tagged cubiq because we have spoke before
Ill create a codepen soon and send it 😄
this should work
This works thank you so much my dude seems like the order I did was incorrect, do you know why it has to be in that order so i can understand why it works? Your great 😄 ❤️
honestly i don't know it just seem logical when i wrote it 😛
I thought :hover would be at the end
easy
it's pseudo-class > pseudo-class > pseudo-element
what you had was pseudo-class > pseudo-element > pseudo-class
:first-child can have :hover, but :first-letter cant
:first-letter:hover
would imply when you hover on the first letter
a:hover:first-letter
would imply when you hover on the a, target the first letterbasically what i said, but less convoluted
:smughamster: