pseudo elements a:after a:before allow you to add text that appears to be part of the link. However, I can\'t seem to figure out a way to make that portion clickable as part
I wrapped the link and the text separately -- the :before goes on the container and the link goes inside. This way I can use the :before as a jQuery tigger and the text as a link. HTML:
- My Link Text
CSS:
li.before-here:before{ //some css like an image }
Jquery:
$("li.before-here").click(function(){ //do something});
I'm using this to create a hide/show toggle in a tree -- this gives me the button I need on the left and allows me to link to the parent.