Possible to make a:after/before pseudo elements clickable as part of the link?

后端 未结 8 1761
不知归路
不知归路 2020-12-16 09:42

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

8条回答
  •  难免孤独
    2020-12-16 10:07

    To avoid modifying the document tree, you could use a JavaScript click handler for a:after.

    Edit: This doesn't work, because pseudo elements aren't added to the DOM.

提交回复
热议问题