ornaments() CSS Function
The ornaments() function swaps characters for ornament glyphs, such as decorative bullets, with font-variant-alternates.
Description
The ornaments() CSS function is one of the functions used with the font-variant-alternates property to switch on alternative glyphs in an OpenType font. It enables ornaments: decorative symbols such as fleurons, dingbats and dividers that a font provides in place of ordinary characters, often mapped to the bullet or letters. It maps to the OpenType ornm feature.
The argument is not a number but a name that you define yourself in a @font-feature-values rule for the font family, inside a @ornaments block. That rule maps the friendly name to the numeric index the font uses, so the same name can mean different glyph sets in different fonts. If the font has no matching feature, or no name is defined, the text is shown with its normal glyphs.
Only one name can be given. A common use is turning a character into a decorative section divider.
@font-feature-values "Spectral" {
@ornaments {
fleuron: 1;
}
}
.divider::before {
content: "\2022";
font-family: "Spectral", serif;
font-variant-alternates: ornaments(fleuron);
}
Syntax
ornaments() = ornaments( <feature-value-name> )
Values
- <feature-value-name>A <custom-ident> defined in the @ornaments block of an @font-feature-values rule for the font family. It maps to the font's OpenType ornm (ornaments) feature.
Example
Browser Support
The following information will show you the current browser support for the CSS ornaments() function. Hover over a browser icon to see the version that first introduced support for this CSS function.
Desktop





Tablets & Mobile





