The font-style property sets text to italic.
The form for a font-style declaration is:
font-style: value.
The values for font-style are: normal, italic and oblique.
Typically italics are used to emphasize text or to cite a source.
There are several HTML tags that show text in italics.
Plain italics: We covered the <i> (italic) tag in the HTML section of this course. It is best used for simple text decoration.
Emphasis: Another tag for italics is <em> (emphasis). Emphasized text appears in italics on a web page, but a text reader will add emphasis to speech when the <em> tag is used. This is a better choice for emphasized text in regard to web accessibilty.
Citation: The <cite> tag is used to display a citation source, such as an author, a book title, or a publication. Text readers allow their users to know the italicized text is, in fact, a citation.
Address: The <address> tag is used to provide any contact information you may want to include about yourself at the botton of a webpage, such as your name, your phone number or your email address. This is commonly found in academic, professional or journalistic pages. This is also identified as an address by text readers. See the bottom of this page.
So we see that the tag you choose to show italic text should be chosen for it's intended purpose.
Sample code
<i>text</i>
<em>emphasized text</em>
<cite>Reader's Digest</cite>
<address>
© 2005, Kent Kyle<br />
Minneapolis, MN<br />
Email: gnubee@webtv.net
</address>
The is a difference between the italic and oblique values, but it is rather complicated to explain and involves a font designer's preferences and/or the distributor of a particular font, such as TrueType or PostScript.
Fonts that have an italic character set will also render as oblique and vice versa.
IE 6.0 and WebTV support both values. Netscape Navigator 7.2 only supports italic, so the italic value has better support than oblique.
Finally, CSS allows us to declare both values, separated by a comma, so we can cover all possibilities.
You can make CSS rules to ensure that italic text tags are read correctly. You may also add font-style to any class that you choose.
Stylesheet Example
i, em, cite { font-style: italic }
<p>This sentence has some <span style="font-style:italic">italic text</span> just for show.</p>
This sentence has some italic text just for show.
I prefer <em> over <i>. When I use the <em> tag, I want to really emphasize my text, so I have declared both italic and bold for the <em> tag. You have seen this style throughout our CSS lessons. This is a personal choice, so I offer this as information only, not a recommendation.
em { font-style: italic; font-weight: bold }
Use font-style on a web page. Post your page.
Happy coding!
Gnubee