Styling External Links Using :has and an Attribute Selector
tylergaw.com·1d
Flag this post

No doubt this has been written about before, but I used this approach yesterday and it’s cool so I’m writing about it too.

Like any good website, I have a pile of links in the footer of this one. Most of the links are to internal pages. A handful of them are to external sites. It’s never bothered me before that the external links aren’t marked as such. But, in a usual fit of procrastination while writing my previous post, I decided those external links now had to be marked in some way.

Each link is an a wrapped in an li element. I’m lazy, so I decided to avoid using any image and instead use the ↗ character. I wasn’t procrastinating so hard that I wanted to create, export, and upload an image.

I didn’t want the ↗ to be…

Similar Posts

Loading similar posts...