i guess follow me @bethposting on bsky or pillowfort


discord username:
bethposting

is there a tidy/concise way to vertically center text over an image that works consistently in chosts?

the ways i've found to do it have been kind of jank (like setting line-height to the same as the overall div height, which only works for single lines of text).

transform: translate works but i feel like there's probably a better way. also i'd rather not have to use tables


You must log in to comment.

in reply to @bethposting's post:

yeah but like either make the image a background-image or an absolute positioned img tag under the flexbox

and use (new) aspect-ratio or (working everywhere) calculated percentage padding to make the box as tall as the image?