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

后端 未结 8 1744
不知归路
不知归路 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:23

    I'm hoping someone has a better solution than this, but just in case not, I did come up with this horrible/crappy/hacky solution:

      a {
         margin-right: 40px;
      }
    
      a:after {
         content: " (" attr(href) ")";
         margin-left: -40px;
      }
    

提交回复
热议问题