我需要在同一文本中混合使用英文汉字和日文汉字。我在W3C (https://www.w3.org/TR/1999/WD-i18n-format-19990127/)上找到了CSS属性layout-grid-type,当它设置为'fixed‘时,看起来就是我需要的。我尝试了下面的代码示例,但是我不能让它像预期的那样工作,like this for example。所有字符(罗马字符、汉字甚至符号)必须具有相同的边界框宽度(无论其间的间距如何)。
<head>
<style>
.example {
layout-grid-type: fixed;
}
</style>
</head>
<body>
<div class="example">layout-grid-typeこ子: fixed</div>
</body>我错过了什么?谢谢。
编辑我意识到上面的W3C文档只是一份草稿,似乎并没有发布。那么,有没有其他适合这种演示风格的呢?
发布于 2021-04-13 11:27:56
谢谢你,凯文,博客澄清了这一切!
此标头足以获取所有地址:所有字符和符号现在都具有相同的宽度。
编辑:这在Firefox only中有效!其他浏览器中的字符宽度不同...回到原来的问题:
<!doctype HTML>
<html lang="ja-jp" />
<head>
<meta charset="utf-8" />
<style>
.example {
text-transform: full-width;
white-space: pre;
}
</style>
</head>
<body>
<div class="example">layo↑t-grid-typeこ子: fixed</div>
<div class="example">layo ut-grid-typeこ子: fixed</div>
<div class="example">123456789012345678901234567890</div>
<div class="example"> 56789012345678901234567890</div>
<div class="example">↑↑←→↓↑↑56789012345678901234567890</div>
<div class="example">↑↑↑↑56789012345678901234567890</div>
</body>https://stackoverflow.com/questions/67035916
复制相似问题