CSS font-family property
Attribute definitions and instructions
font - family property to specify a font element.
font-family can take several font names as a "fallback" to save the system. If your browser does not support the first font, it tries the next one.
There are two types of font family names:
- family-name - Specifies the name of the series: the specific name of the font, such as: "times", "courier" , "arial".
- generic-family - usually font family name: For example: "serif", "sans- serif", "cursive", "fantasy", "monospace.
Use a specific font family (Geneva) depends entirely on the user's machine that font family is available; this attribute does not indicate any font download. Therefore, it is strongly recommended to use a generic font family name as the posterior.
Note: Each value is separated by a comma.
NOTE: If the font name contains spaces, it must be quoted.When using the "style" attribute in HTML, you must use single quotes.
Defaults: | not specified |
---|---|
inherit: | yes |
version: | CSS1 |
JavaScript syntax: | object .style.fontFamily = "arial, sans-serif" |
Browser Support
Figures in the table represent the first browser to support the version number of the property.
属性 | |||||
---|---|---|---|---|---|
font-family | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Property Value
value | description |
---|---|
| A priority table for the font family name of an element or / and class family name. Default: depends on the browser. |
inherit | Provisions font family should inherit from the parent element. |
related articles
CSS tutorial: CSS the Font
CSS Reference: font properties