Get the latest tech news

Two examples of hover styles on images


When I hover over an image, I can add a border to a link, or change the colours of an SVG icon.

If I’m showing a small preview of an image that’s a clickable link to the full-sized version, I like to add a coloured border when you hover over it. The better approach I’ve found is to add a box-shadow with no blur – this looks like a border, but it’s purely visual and doesn’t take up any space on the page. I made these icons look good on a sans-CSS page by adding inline fill attributes to the background/foreground elements (e.g.<circle fill="white" …>).

Get the Android app

Or read this on Hacker News

Read more on:

Photo of images

images

Photo of examples

examples

Photo of hover styles

hover styles

Related news:

News photo

Stability claims its newest Stable Diffusion models generate more ‘diverse’ images

News photo

First images from Euclid are in

News photo

These alleged OnePlus 13 images might've confirmed some changes