Font-style

CSS font-style property sets font-style for a text. We have three options by using this property: normal, italic and oblique.

CSS Syntax

font-style: normal | italic | oblique | initial | inherit;

Let's see an example:

<!DOCTYPE html>
<html>
  <head>
    <style>
       p.normal {font-style: normal;}
       p.italic {font-style: italic;}
       p.oblique {font-style: oblique;}
    </style>
  </head>
  <body>

     <p class="normal">We wrote this text as normal.</p>
     <p class="italic">We wrote this text as italic.</p>
     <p class="oblique">We wrote this text as oblique.</p>

  </body>
</html>

Here the result is:


Property Values

Value Descriptions
normal It means that text characters will be normal. It is the default value of this property.
italic When we use this value, the text will be shown as italic.
oblique When we use this value, the text will be shown as oblique.
initial It makes the property use its default value.
inherit It inherits the property from its parents element.