DEV Community

Discussion on: Border with gradient and radius

Collapse
 
natedolesh profile image
Nate Dolesh

Thanks, it could work in some situations, although two issues:

  1. I had to add z-index: -1; to the ::before pseudo element to make the content clickable/selectable
  2. After doing the above, the border won't be visible if any parent element has a background
Collapse
 
afif profile image
Temani Afif

if you are adding z-index:-1 to the pseudo element you need to add z-index:0 to the main element to avoid the issue OR don't use z-index at all and add pointer-events:none to the pseudo element

Collapse
 
natedolesh profile image
Nate Dolesh

Thank you! That does fix it!