Thursday, November 17, 2022

[FIXED] What is the vertical equivalent of CSS font-kerning?

Issue

I have a font that is misaligned since the baseline is below y, g, j, etc. as opposed to regular baseline.

I've tried messing around with a few properties (line-height, height, display: inline-block, vertical-align: text-top) but can't get the font as far centered as it should be.

Is there a CSS equivalent of kerning, but in a vertical direction? Is there another way to uniformly fix this font via CSS?


Solution

This is a very old question, but the solution I ended up using (as with most CSS) was to create a wrapper and pad asymmetrically, therefore raising the apparent baseline.

The main use-case was with headers with large border-radius causing slight (visual) vertical mis-alignment.



Answered By - neaumusic
Answer Checked By - Mildred Charles (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.