font-style

Browser Internet Explorer Netscape Opera Safari Firefox
Version 5.5 6.0 7.0 8.0 8.0 9.0 7.0 8.0 9.2 9.5 1.3 2.0 3.1 1.5 2.0 3.0
Supported Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes

Short information
CSS CSS2
Default value normal
Inherited Yes
Applied To all elements
HTML analog <l>
Reference to specification http://www.w3.org/TR/CSS21/fonts.html#propdef-font-style

Description
This argument determines font protraction – normal, italic, oblique. When you install italic or oblique protraction for text, in that case a browser will access to the system for certain font search. If it does not find the font, a browser uses a special algorithm for needed text type simulation. The result and quality can be negative especially while the document is being printed.

Syntax

font-style: normal | italic | oblique

Arguments
normal
Normal text protraction
italic
Italic protraction.
oblique
Oblique font. Italic and oblique fonts are not the same. Italic font is a special font simulating manuscript, oblique ones with the help of normal marks oblique right.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
  <title>font-style</title>
  <style type="text/css">
   H1 {
    font-family: Verdana, Arial, Helvetica, sans-serif; /* Sans-serif type of the title */
   } 
   P {
    font-family: 'Times New Roman', Times, serif; /* Font with serifs */
    font-style: italic; /* Slanted character */
   }
  </style>
 </head>
 <body> 
 
  <h1>Duis te feugifacilisi</h1>
  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem 
  nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. 
  Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit 
  lobortis nisl ut aliquip ex ea commodo consequat.</p>
 
 </body>
</html>

The result of this example is shown on the figure 1


Object model

[window.]document.getElementById("elementID").style.fontStyle

Remark
In the browser Internet Explorer font with the value "italic" and "oblique" is always shown as italic.