Aligning text smartly in CSS

Here’s a clever way to get text centred when it’s short, but left-aligned when it wraps.

Tagged with

Related links

Web development tip: disable pointer events on link images

Here’s a little snippet of CSS that solves a problem I’ve never considered:

The problem is that Live Text, “Select text in images to copy or take action,” is enabled by default on iOS devices (Settings → General → Language & Region), which can interfere with the contextual menu in Safari. Pressing down on the above link may select the text inside the image instead of selecting the link URL.

Tagged with

Responsive Letter Spacing – Cloud Four

Another clever use of clamp() and calc() for web typography, but this time it’s adjusting letter-spacing.

Tagged with

My requests for Interop 2026 | Clagnut by Richard Rutter

Every one of these five proposals is worth a vote.

Mind you, Rich’s cynicism is understandable.

Tagged with

Matthias Ott – Painting With the Web – beyond tellerrand Düsseldorf 20025 - YouTube

A great talk by Matthias on what you can do with web standards today!

Tagged with

Polishing your typography with line height units | WebKit

I should be using the lh and rlh units more enough—they’re supported across the board!

Tagged with

Related posts

CSS snippets

Some styles I re-use when I’m programming with CSS.

Who knows?

Had you heard of these bits of CSS? Me too/neither!

Making the Patterns Day website

The joy of getting hands-on with HTML and CSS.

Sass and clamp

Worst buddy movie ever.

Utopia

Why do I like fluid responsive typography? Let me count the ways…