XML technologies / CSS / Advanced websites with CSS / CSS property reference / font-style

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

The property font-style describes the style of a font in a text element. Text can be displayed as normal, oblique or italic.

Inherited: yes

See also: font

Values

normal, oblique or italic.

Default value: normal

Compatibility

CSS version: 1

Works in all CSS-capable browsers. Most browsers simply slant a normal font if no separate italic font is available. Most browsers also use oblique as a synonym for italic. Both values produce simple italics.

Example

Most browsers’ default stylesheets display text emphasised with the element em in italics. To change the style, first set font-style to normal and use the property text-decoration to underline the text:

em {
 font-style: normal;
 text-decoration: underline;
}

  

 

 

 

back to top