@font-face
Summary
The @font-face CSS at-rule allows authors to specify online fonts to display text on their web pages. By allowing authors to provide their own fonts, @font-face eliminates the need to depend on the limited number of fonts users have installed on their computers.
The @font-face
at-rule may be used not only at the top level of a CSS, but also inside any CSS conditional-group at-rule.
Syntax
@font-face {
[font-family: <family-name>;]?
[src: [ <uri> [format(<string>#)]? | <font-face-name> ]#;]?
[unicode-range: <urange>#;]?
[font-variant: <font-variant>;]?
[font-feature-settings: normal|<feature-tag-value>#;]?
[font-stretch: <font-stretch>;]?
[font-weight: <weight>];
[font-style: <style>];
}
Values
- <family-name>
- Specifies a font-family name that will be used as font face value for font properties.
<uri> - The location of a font file to use (either an external reference with an optional hint or a local reference). To specify an external reference, use url(sURL), where sURL is an absolute or relative URL. To specify specific font formats (only for externally referenced font files), use a format hint (format(fontFormat)) where fontFormat is a comma-separated list of format strings that denote supported font formats. Possible fontFormat values are woff, truetype, opentype, and embedded-opentype. The format hint is optional.
- *To specify a local reference, use **local(sFontName)**, where **sFontName** is the name of the locally-installed font to use. If that font is not found, other sources will be tried until one is found.*
-
**\
** - *A list of Unicode character ranges, where*urange*is a comma-separated list of Unicode range values.*
-
**\
** - *A [**font-variant**](/css/properties/font-variant) value.*
-
**\
** - *A valid [**font-stretch**](/css/properties/font-stretch) property value.*
-
**\
** - *A valid [**font-weight**](/css/properties/font-weight) property value (except for the relative values, `bolder` and `lighter`).*
- **\