font-kerning CSS property sets the use of the kerning information stored in a font.

The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.

Kerning defines how letters are spaced. In well-kerned fonts, this feature makes character spacing more uniform and pleasant to read than it would otherwise be.

In the image below, for instance, the examples on the left do not use kerning, while the ones on the right do:

Example of font-kerning

句法

font-kerning property is specified as one of the keyword values listed below.

auto

The browser determines whether font kerning should be used or not. For example, some browsers will disable kerning on small fonts, since applying it could harm the readability of text.

normal

Font kerning information stored in the font must be applied.

none

Font kerning information stored in the font is disabled.

形式定义

初始值 auto
适用于 所有元素。它还适用于 ::first-letter and ::first-line .
继承 yes
计算值 如指定
动画类型 discrete

形式句法

auto | normal | none
					

范例

Enabling and disabling kerning

HTML

<div id="kern"></div>
<div id="nokern"></div>
<textarea id="input">AV T. ij</textarea>
					

CSS

div {
  font-size: 2rem;
  font-family: serif;
}
#nokern {
  font-kerning: none;
}
#kern {
  font-kerning: normal;
}
					

JavaScript

let input  = document.getElementById('input');
let kern   = document.getElementById('kern');
let nokern = document.getElementById('nokern');
input.addEventListener('keyup', function() {
  kern.textContent = input.value; /* Update content */
  nokern.textContent = input.value;
});
kern.textContent = input.value; /* Initialize content */
nokern.textContent = input.value;
					

规范

规范 状态 注释
CSS Fonts Module Level 3
The definition of 'font-kerning' in that specification.
候选推荐 初始定义。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
font-kerning Chrome 完整支持 33
完整支持 33
不支持 29 — 33 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Edge 完整支持 79 Firefox 完整支持 32
完整支持 32
不支持 24 — 34 Disabled
Disabled ). To change preferences in Firefox, visit
IE 不支持 No Opera 完整支持 20
完整支持 20
不支持 16 — 20 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Safari 完整支持 9 WebView Android 完整支持 4.4.3
完整支持 4.4.3
不支持 4.4 — 4.4.3 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Chrome Android 完整支持 33
完整支持 33
不支持 29 — 33 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Firefox Android 完整支持 32
完整支持 32
不支持 24 — 34 Disabled
Disabled ). To change preferences in Firefox, visit
Opera Android 完整支持 20
完整支持 20
不支持 16 — 20 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Safari iOS 完整支持 9 Samsung Internet Android 完整支持 2.0
完整支持 2.0
不支持 1.0 — 2.0 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-

图例

完整支持

完整支持

不支持

不支持

用户必须明确启用此特征。

用户必须明确启用此特征。

要求使用供应商前缀或不同名称。

要求使用供应商前缀或不同名称。

另请参阅

元数据

  • 最后修改: