DEV Community

Discussion on: 4 CSS tricks that will get you dirty looks from other developers

Collapse
 
gabbersepp profile image
Josef Biehler

Nice. Did not know the trick to expand the clickable area!

Collapse
 
cydstumpel profile image
Cyd

It's my favourite thing, so useful!

Collapse
 
salvan13 profile image
Antonio Salvati ๐ŸฆŠ • Edited

Nice trick!
btw I'd avoid to overlap other texts otherwise they become unselectable

Thread Thread
 
cydstumpel profile image
Cyd

True! This is a big downside to using before

Thread Thread
 
salvan13 profile image
Antonio Salvati ๐ŸฆŠ • Edited

In that case maybe it's better to wrap the whole element in a a tag :)

Thread Thread
 
5t3ph profile image
Stephanie Eckles

You can also use a container around selectable text and set it to position: relative: z-index: 1 to bring it above the link click area ;) It removes the text from being part of the click area but I would suggest selectable text is a higher priority and you still get the benefit of the rest of the card becoming clickable.