English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
font-The style CSS attribute defines the font style of the element's text content.
The following table provides usage instructions and version history of this attribute, as well as its usage syntax in JavaScript scripts.
Default value: | normal |
---|---|
Applicable to: | All elements |
Inheritance: | Yes |
Can be animated: | No.Please see Animation properties. |
Version: | CSS 1,2,3 |
JavaScript syntax: | object.style.fontStyle="italic" |
The syntax of this attribute is as follows:
font-style: normal | italic | oblique | initial | inherit
The following example demonstrates how to use font-style attribute.
p { font-style: italic; }Test and see‹/›
The following table describes the value of this attribute.
Value | Description |
---|---|
normal | The browser displays a standard font style. |
italic | The browser will display a italic font style. |
oblique | The browser will display a italic font style. |
inherit | If specified, the associated element adopts its parent element font-style attribute values. |
Note:If there is no available italic or oblique, the oblique face can be rendered to synthesize the slope face by applying an oblique transformation to the slope face.
font-The compatibility of style attribute across browsers, the numbers in the table below represent the minimum version number of the browser that supports this attribute; all mainstream browsers support this attribute.
|
Please refer to the following tutorials:CSS font,CSS text.
Related attributes and rules:font,font-variant,font-weight,font-size,line-height,font-family,@font-face.