How 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:
- Using CSS sprites for image navigation (Saturday, February 28th 2009)
- Favicon tag (Saturday, February 7th 2009)
- Using !important with CSS (Saturday, January 31st 2009)
- Switch off autocomplete for an HTML form field (Saturday, December 6th 2008)
- How to do the TM symbol in HTML (Saturday, November 8th 2008)
- Remove cellpadding and cellspacing from an HTML table with CSS (Wednesday, November 5th 2008)

Comments
blog comments powered by Disqus