# font-variant-ligatures

> The `font-variant-ligatures` CSS property controls the usage of ligatures and contextual forms.

## How do I disable ligatures in a code font in CSS?

The property that controls the use of ligatures, which are special character combinations, like fi or fl, that are replaced with a single glyph. It can enable or disable standard or discretionary ligatures, improving the flow and appearance of text.

- Topic: Font Features
- Type: property
- Browser support: Chrome 34+, Chrome Android 34+, Edge 79+, Firefox 34+, Firefox Android 34+, Safari 9.1+, Safari iOS 9.3+

## Example

Wrong:

```css
code {
  font-feature-settings: "liga" 0, "calt" 0;
}
```

Right:

```css
code {
  font-variant-ligatures: none;
}
```

'none' turns off all ligatures and contextual forms without replacing other font features.

## Common mistakes

- Ligatures disappear after adding `letter-spacing` and it looks like a bug.

## Key points

- Ligatures are turned off with `font-variant-ligatures: none`, not with raw 'liga' and 'calt' tags.
- Code blocks that must show exact characters disable ligatures.
- 'discretionary-ligatures' is used only on display text, not body text.

## Interview questions

### Why do ligatures disappear with letter-spacing?

Browsers do not apply optional ligatures when the space between characters is not zero, so `letter-spacing` turns them off.

### What is the difference between common and discretionary ligatures?

Common ligatures like 'fi' are on by default for readability. Discretionary ones are decorative and must be turned on.

## Related cards

- [font-variant](https://wonderium.dev/css/font-variant.md)
- [font-feature-settings](https://wonderium.dev/css/font-feature-settings.md)
- [letter-spacing](https://wonderium.dev/css/letter-spacing.md)
- [`<code>`](https://wonderium.dev/html/code.md)
- [text-rendering](https://wonderium.dev/css/text-rendering.md)

---

- Level: [CSS](https://wonderium.dev/css.md)
- HTML version: https://wonderium.dev/css/font-variant-ligatures
- Last updated: 2026-11-25
