CSS font-style

The CSS font-style property is used to style the font of text. For example:

HTML with CSS Code
<!DOCTYPE html>
<html>
<head>
   <style>
      .one{font-style: normal;}
      .two{font-style: italic;}
      .three{font-style: oblique;}
   </style>
</head>
<body>

   <h2 class="one">font-style: normal</h2>
   <h2 class="two">font-style: italic</h2>
   <h2 class="three">font-style: oblique</h2>
   
</body>
</html>
Output

font-style: normal

font-style: italic

font-style: oblique

CSS font-style Syntax

The syntax of font-style property in CSS, is:

font-style: x;

The value of x should be any of the following:

CSS Online Test


« Previous Tutorial Next Tutorial »