Sunday, January 18, 2009

The font-style property

The font-style property has four possible values: italic, oblique, normal, and inherit.
The first two values set the font to italic type or oblique type. Oblique type is a form of type that slants slightly to the right. Italic refers to cursive typefaces based on a stylized form of calligraphic handwriting. Italic typefaces usually slightly slant to the right — wikipedia.
Example: <p style="font-style:italic">the five boxing wizards jump quickly</p>
Usually, serif typefaces contain italic fonts and sans-serif typefaces contain slanted or oblique fonts. However, it is common for slanted sans-serif fonts to be named italic. It is extremely rare for a typeface to contain both an oblique typeface and an italic typeface. When specifying oblique text, the browser will use italic fonts if an oblique font is not available and vice versa. Therefore, with most typefaces, the css declaration of italic and oblique have the same effect — with serif typefaces you get italics and sans-serif typefaces you get oblique.
Browser Support
Firefox 3, Opera 9.6, Internet Explorer 6, Internet Explorer 7 and Safari 3.2 all handle font-style in the same way. The values italic and oblique have the same effect - the browser uses italic fonts with serif typefaces and oblique fonts with serif typefaces. If an italic or oblique font is not available in the typeface, the browser simulates oblique type by slanting normal type. The property font-style is inherited.

No comments: