font-feature-settings property gives you low-level control over OpenType font features.
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.
The syntax of the
font-feature-settings property is:
These values are explained in more detail below.
- Specifies that that no change in glyph selection or positioning occurs due to this property.
- 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.
This is an optional value that can be used for glyph selection. It must be a valid integer of
If the value is
0, the feature is disabled. If used on a boolean feature, a value of
1enables the feature. When used on non-boolean features, a value of
1or greater enables the feature and indicates the feature selection index.
If this value is omitted, a value of
- Synonymous with
- Synonymous with
In addition, all CSS properties also accept the following CSS-wide keyword values as the sole component of their property value:
- Represents the value specified as the property's initial value.
- Represents the computed value of the property on the element's parent.
- This value acts as either
initial, 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.
- Initial Value
- Applies To
- All elements
- CSS Fonts Module Level 3 (W3C Candidate Recommendation 3 October 2013)
For maximum browser compatibility many web developers add browser-specific properties by using extensions such as
-webkit- for Safari, Google Chrome, and Opera (newer versions),
-ms- for Internet Explorer,
-moz- for Firefox,
-o- for older versions of Opera etc. As with any CSS property, if a browser doesn't support a proprietary extension, it will simply ignore it.
This practice is not recommended by the W3C, however in many cases, the only way you can test a property is to include the CSS extension that is compatible with your browser.
The major browser manufacturers generally strive to adhere to the W3C specifications, and when they support a non-prefixed property, they typically remove the prefixed version. Also, W3C advises vendors to remove their prefixes for properties that reach Candidate Recommendation status.
Many developers use Autoprefixer, which is a postprocessor for CSS. Autoprefixer automatically adds vendor prefixes to your CSS so that you don't need to. It also removes old, unnecessary prefixes from your CSS.
You can also use Autoprefixer with preprocessors such as Less and Sass.