CSS 提供的 font-kerning 属性在确定特定字母对的间隔方式时非常有用。
可能的值
- auto:浏览器决定是否应应用字体字距调整。
- normal:必须使用存储在字体中的字体字距调整信息。
- none:禁用存储在字体中的字体字距调整信息。
适用于
所有 HTML 元素。
DOM 语法
object.style.fontKerning = "normal";
CSS 字体字距调整 - 基本示例
下面是一个示例:
<html>
<head>
<style>
div {
font-size: 2rem;
font-family: serif;
}
#nokern {
font-kerning: none;
}
#kern {
font-kerning: normal;
}
#auto {
font-kerning: auto;
}
</style>
</head>
<body>
<h2>Font kerning</h2>
<div id="kern">AV</div>
<div id="nokern">AV</div>
<div id="auto">AV</div>
</body>
</html>