Home / How to make a font italic with CSS

How to make a font italic with CSS

I am always forgetting how to make a font italic with CSS so this very brief post shows how to do it. Maybe then I’ll actually remember…

font-style

The CSS property ‘font-style’ is used to specify whether a font is one of:

  • normal
  • oblique
  • italic

The default is ‘normal’ and most browsers treat ‘oblique’ as ‘italic’.

So here’s an example:

<style type="text/css">
#example {
    font-style: italic;
}
</style>
<p id="example">This text will be in italics</p>

And here it is in action:

This text will be in italics

Easy… now maybe I’ll remember.