I am trying to apply some css to the current viewed menu item on a WordPress site. I can apply css to the whole item, but want to apply something to specifically just the last character.
Does anyone have any thoughts on how to go about this?
Thanks.
The is no cross browser solution to achieve it using pure CSS.
You can either using PHP or javascript to get the last character and style it or you can wrap that last character in another element like
<span>
and style it using css as normally.EDIT: Here is the javascript approach:
Fiddle Demo
As Felix said, there is no cross browser solution to achieve it using pure CSS. I would reccommend writing simple js code to split menu item and add span with class to last letter.