Lately I've been working with Japanese text, and I've found a rather annoying property. In Japanese, unlike English, glyphs do not extend below the text baseline. This example should show what I mean:
div {
font-size: 72pt;
display: inline-block;
text-decoration: underline;
border: 1px solid red;
margin: 10px;
text-align: center;
}
<div lang="ja">日本語</div>
<div lang="en">English</div>
Notice how the "g" in "English" extends below the underline, but none of the characters in 日本語 do. This is typical of Japanese text. Despite this, space is still reserved below the underline, and in fact on my screen the Japanese text reserves more space than the English text does. My question is this:
Is there a way to remove this space with CSS which is reliable across changing fonts and font sizes? I can see at least two possible approaches:
- Remove the space below the baseline directly.
- Move the baseline to be at the bottom of the containing box.