The font property is used in CSS and certain HTML elements. It is a shorthand property for setting font-style, font-variant, font-weight, font-size, line-height and font-family in a single CSS declaration.
Values[]
| Value | Description |
|---|---|
<style> |
See font-style for values.
|
<variant> |
See font-variant for values.
|
<weight> |
See font-weight for values.
|
<size> |
See font-size for values.
|
<line-height> |
See line-height for values.
|
<family> |
See font-family for values.
|
Any values from the properties listed above can be used in this property. A single space is required to separate each value.
HTML example:
<span style="font:bold 12pt Arial;">QWERTY</span>
That produces: QWERTY
CSS example:
h1 {
font:bold 12pt Arial;
}
