font property
Specifies up to six separate font properties, in a shorthand form.
The font property allows you to specify what kind of letter is used for the visual representation of the element.
You can change the style, weight, size, the font family, and more, but if you want to change the color of the text,
you must use the color property.
Specifying more than one font-family is recommended, because different font family names are supported by different platforms.
For details, see the page for the font-family property.
These features can be set with six different style properties too, listed below.
The use of separate properties is highly recommended for non-advanced authors for better controllability.
JavaScript page for this property: font. You can find other example(s) there. |
Possible values:
One of the following values: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Description of values:
The font used in buttons. | |||||||
The font used on the desktop. | |||||||
The font used in dialogs. | |||||||
The font used in documents. | |||||||
The font used in fields. | |||||||
The font used in info. | |||||||
The font used in lists. | |||||||
The font used in pull-down-menus. | |||||||
The font used in windows. | |||||||
The font used in workspaces. | |||||||
The font used in controls. | |||||||
The font used in mini controls. | |||||||
The font used in small controls. | |||||||
The font used for objects that have captions. | |||||||
Specifies the font face for text. | |||||||
Specifies the font size of the text. | |||||||
Specifies whether the style of the font is normal, italic or oblique. | |||||||
Specifies a variation of the specified or default font-family. | |||||||
Specifies the font weight of the text. | |||||||
The font used to icon labels. | |||||||
Takes the value of this property from the computed style of the parent element. | |||||||
Specifies the distance between lines of text in a block-level element. | |||||||
The font used in menus. | |||||||
The font used in dialog boxes. | |||||||
The font used in small controls. | |||||||
The font used in window status bars. |
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the font property:
|
||||
<head> <style> .example { font: italic normal 600 medium/1.2em serif; } </style> </head> <body> <a class="example">font: italic normal 600 medium/1.2em serif</a> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
a, abbr, acronym, address, b, baseFont, bdo, big, blink, blockQuote, body, button, caption, center, cite, code, col, colGroup, dd, del, dfn, dir, div, dl, dt, em, fieldSet, font, form, H1, H2, H3, H4, H5, H6, html, i, input:button, input:file, input:password, input:reset, input:search, input:submit, input:text, ins, isIndex, kbd, label, legend, li, listing, marquee, menu, nobr, ol, optGroup, option, p, plainText, pre, q, rt, ruby, s, samp, select, small, span, strike, strong, sub, sup, table, tBody, td, textArea, tFoot, th, tHead, tr, tt, u, ul, var, xmp
Related pages:
color
font-family
font-size
font-size-adjust
font-style
font-variant
font-weight
text-align
text-align-last
text-autospace
text-decoration
text-indent
text-justify
text-kashida-space
text-overflow
text-shadow
text-transform
text-underline-position
font-family
font-size
font-size-adjust
font-style
font-variant
font-weight
text-align
text-align-last
text-autospace
text-decoration
text-indent
text-justify
text-kashida-space
text-overflow
text-shadow
text-transform
text-underline-position
External links:
User Contributed Comments