CSS: Text, Fonts, and Tables - Fonting with Style
(Page 4 of 6 )
You can set the style of your font using font-style. Here is how!
<html>
<head>
<style type="text/css">
h1 {font-style: italic}
h2 {font-style: normal}
p {font-style: oblique}
</style>
</head>
<body>
<h1>I like to eat meatballs</h1>
<h2>I'm pretty normal</h2>
<p>I don't know what oblique means</p>
</body>
</html>
Setting the Variant of a Font
You can set the variant of a font like this:
<html>
<head>
<style type="text/css">
p.normal {font-variant: normal}
p.smallcaps {font-variant: small-caps}
</style>
</head>
<body>
<p class="normal">This is normal</p>
<p class="smallcaps">This is small caps...</p>
</body>
</html>
Next: How to Set the Boldness of a Font >>
More Style Sheets Articles
More By James Payne