The best CSS font properties Tutorial In 2024, In this tutorial you can learn Examples,Attribute definitions and instructions,Browser Support,Font properties,More examples,related articles,
Specify all font properties in one declaration:
font shorthand property sets all the font properties in one declaration.
Settable properties are (in order): "font-style font-variant font-weight font-size / line-height font-family"
The value of font-size and font-family is required. If the lack of other values, the default values will be inserted, if there is a default value of words.
Note: line - the space between the rows and row height properties.
Defaults: | not specified |
---|---|
inherit: | yes |
version: | CSS1 |
JavaScript syntax: | object .style.font = "italic small-capsbold 12px arial, sans-serif" |
Figures in the table represent the first browser to support the version number of the property.
属性 | |||||
---|---|---|---|---|---|
font | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
value | description |
---|---|
font-style | Prescribed font style. See: font-style for possible values. |
font-variant | Chinese fonts specified. See: font-Variant of possible values. |
font-weight | Prescribed font weight. See: font-weight for possible values. |
font-size / line-height | Font size and line height regulations. See: font-size and line-height of possible values. |
font-family | Provisions of the font family. See: font-Family of possible values. |
caption | The title font is defined controls (such as buttons, drop-down lists, etc.) used. |
icon | Define the font to be used marked with an icon. |
menu | Definition is the drop-down list of fonts to use. |
message-box | Define the font used by the dialog box. |
small-caption | Small versions caption fonts. |
status-bar | Define the font to be used in the window status bar. |
Some other font property values
This example demonstrates some other font property values.
CSS tutorial: CSS the Font