CSS font-feature-settings
The font-feature-settings property gives you low-level control over OpenType font features.
The font-feature-settings property is one of the properties introduced in CSS3 for enabling various font related features that can improve the appearance of the text on the page. The font-feature-settings property was specifically intended as a way of providing access to font features that are not widely used but are needed for a particular use case.
Syntax
The syntax of the font-feature-settings property is:
Where
These values are explained in more detail below.
Possible Values
normal- Specifies that that no change in glyph selection or positioning occurs due to this property.
- string
- This value specifies a case-sensitive OpenType feature tag (OpenType feature tags contain four ASCII characters). The value must be a valid string of four ASCII characters and be within the U+20-7E codepoint range.
- integer
-
This is an optional value that can be used for glyph selection. It must be a valid integer of
0or more.If the value is
0, the feature is disabled. If used on a boolean feature, a value of1enables the feature. When used on non-boolean features, a value of1or greater enables the feature and indicates the feature selection index.If this value is omitted, a value of
1is assumed. on- Synonymous with
1. off- Synonymous with
0.
In addition, all CSS properties also accept the following CSS-wide keyword values as the sole component of their property value:
initial- Represents the value specified as the property's initial value.
inherit- Represents the computed value of the property on the element's parent.
unset- This value acts as either
inheritorinitial, depending on whether the property is inherited or not. In other words, it sets all properties to their parent value if they are inheritable or to their initial value if not inheritable.
General Information
- Initial Value
normal- Applies To
- All elements
- Inherited?
- Yes
- Media
- Visual
- Animatable?
- No
Example Code
Official Specifications
- CSS Fonts Module Level 4
- CSS Fonts Module Level 3 (W3C Recommendation 20 September 2018)
Browser Support
Browser support for CSS properties can vary, particularly for newer or experimental features. Check current browser compatibility before using a property in production, especially when supporting older browsers.
Initial Value
CSS properties have an initial value that applies when the property has not been explicitly set. The initial value is different from the value inherited from a parent element and may vary between properties.
Inheritance
Some CSS properties inherit their computed value from their parent element by default, while others do not. The inherit, initial, unset, and revert keywords can also be used to control how a property gets its value.
Vendor Prefixes
Most modern CSS properties use the standard, unprefixed syntax. Vendor-prefixed properties such as -webkit- are mainly relevant to older browser versions or specific features and should only be used when required by your browser support targets.