Unstyling Image Links

The Problem

If all links are styled with, say, a border-bottom, links with images insde get that too and it looks ick. This problem comes up a lot if you want links in an article to be cute, but you have images as links sometimes.

This is a link with a cute dotted border

Fixes

Set images inside links to be display block. Feels hacky. Obviously limiting.

Use jQuery to find links with images inside and then style it.

Manually add a class to links with images inside.

Update: 2024 - We now have :has()

My opinion

Don't style links with borders.