TIL how to make numbers the same width and prevent shifting layout
POSTED ON:
I give up at how font characters are different sizes. Outside of just changing font types, you're kinda screwed.
But there's hope with numbers. It's called font-variant-numeric
i think i've shared this tip before but if your font supports it, you can use
font-variant-numeric: tabular-nums
in your CSS to keep your numerals the same width and prevent shifting layout.
✨i think i've shared this tip before but if your font supports it, you can use `font-variant-numeric: tabular-nums` in your CSS to keep your numerals the same width and prevent shifting layout. pic.twitter.com/uqFDLXmI4T
— henry ✷ (@xdesro) March 27, 2022
The font-variant-numeric
CSS property controls the usage of alternate glyphs for numbers, fractions, and ordinal markers.
via MDN
Related TILs
Tagged: css