mastodon.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
The original server operated by the Mastodon gGmbH non-profit

Administered by:

Server stats:

357K
active users

Hi, mastodon 🦣 I have a new article out!

A Deep Dive into the Inline Background Overlap Problem: frontendmasters.com/blog/overl

How do you get the below result (semi-transparent background on inline span) with large padding & no overlap?

Answer in article, but think a bit about it first. 😼

#CSS#SVG#filter
Ana Tudor 🐯

If we have an inline `span` inside a `p` & we give it a semi-transparent `background` + a `padding`, we get an alpha increase where backgrounds of adjacent lines overlap.

How would you solve this problem without text duplication, without stacking 2 identical `p` elements, one for background (opaque background + transparent text + opacity) and one for text (transparent background)?

#CSS#SVG#filter

@anatudor I’m a dumbass so I’d probably artificially inflate line-height

@mosen The overlap is desired, but not the increase in alpha.

@anatudor I’m happy to learn that’s why I follow you hehe