The CSS font-style property selects between normal (sometimes referred to as “roman” or “upright”), italic and oblique faces within a font family.
CSS property font-style
CSS version: | CSS 2.1 |
Value: | normal | italic | oblique | inherit |
Initial: | normal |
Applies to: | all elements |
Inherited: | yes |
Example – font-style
In the following code, CSS property font-style can be changed to the following values
- normal
- italic
- oblique
<style type="text/css"> div { width: 100px; font: 14px/18px sans-serif; font-style: normal; } </style> <div>This is sample text to test font-style property</div>
font-style refresh