How to make a font italic with CSSHow to make a font italic with CSS

Posted February 21st, 2009 in HTML and 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.

Related posts:

Comments

blog comments powered by Disqus