CSS - font-style


Advertisements


Description

The font-style property determines the use of one of three font faces to be used in the rendering of a given element's text.

Possible Values

  • normal − Specifies a normal font face; that is, whatever is the default face for the font in use.

  • italic − Specifies an italic font face; that is, one which is slanted and in which the characters have been modified to improve legibility in their slanted state.

  • oblique − Specifies an oblique font face; that is, one which is slanted.

Applies to

All the HTML elements

DOM Syntax

object.style.fontStyle = "italic";

Example

Here is the example using this property −

<html>
   <head>
   </head>
   <body>
      <p style="font-style:italic;">
      This text will be rendered in italic style
      </p>
   </body>
</html> 

This will produce following result −



Advertisements