Wrapping elements in an anchor tag is an a11y no-no.

March 11, 2020 , I learned...

That’s what Chris says by way of Adrian Roselli. I’m certainly guilty of that right here on this site, so perhaps I need to re-think that approach.

Apparently, targeting the ::after pseudo-element of a link is off limits, too, due to text selection.

[[code]]czoxNDM6XCIuY2FyZCB7CiAgcG9zaXRpb246IHJlbGF0aXZlOwp9CgouY2FyZCBoMiBhOjphZnRlciB7CiAgY29udGVudDogXCJcIjsKIHtbJiomXX0gcG9zaXRpb246IGFic29sdXRlOwogIHRvcDogMDsKICBsZWZ0OiAwOwogIHdpZHRoOiAxMDAlOwogIGhlaWdodDogMTAwJTsKfVwiO3tbJiomXX0=[[/code]]

I have to admit: that certainly looks tempting. Hetdon Pickering offers a JavaScript alternative that’s even more tempting — and accessible for that matter:

[[code]]czozMDk6XCJjb25zdCBjYXJkcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXCcuY2FyZFwnKTsgIApBcnJheS5wcm90b3R5cGUuZntbJiomXX1vckVhY2guY2FsbChjYXJkcywgY2FyZCA9PiB7ICAKICBsZXQgZG93biwgdXAsIGxpbmsgPSBjYXJkLnF1ZXJ5U2VsZWN0b3IoXCdoMntbJiomXX0gYVwnKTsKICBjYXJkLm9ubW91c2Vkb3duID0gKCkgPT4gZG93biA9ICtuZXcgRGF0ZSgpOwogIGNhcmQub25tb3VzZXVwID0gKCkgPXtbJiomXX0+IHsKICAgIHVwID0gK25ldyBEYXRlKCk7CiAgICBpZiAoKHVwIC0gZG93bikgPCAyMDApIHsKICAgICAgbGluay5jbGljaygpOwoge1smKiZdfSAgIH0KICB9Cn0pO1wiO3tbJiomXX0=[[/code]]

No matter the approach, it’s a sticky situation. Perhaps Chris is right that linking the actual content is a better way to go. If something is a link, make it look like a link, right? I could see an argument that calls cards as links an anti-pattern.