::first-word css pseudo selector on a 'li' item error

Hi everybody!

Would you be please help me to understand, why does the “::first-word” selector not working on a “li” element?

I wanted to use it at the “Tribute page” project, but after a while I decided to solve it with

, by the way, I’m courious about the reason of the error.

It would be a much nicer solution.


I think the problem is ::first- word selector does not exist. Try using it on a <p> and see what happens. I think<strong> or <span> are the only options in css. I saw a blog online, in which the author said he wishes it existed, but I am afraid it doesnt.

According to DOM:

All pseudo-elements

All in all a good question, I was also wondering about that once:

1 Like