HTML Cookbook Basic HTML Course

It's Easy!


Alternate Version

Font Variant

The font-variant property allows you to convert lower case letters to small capitals.

Font-variant Declaration

The declaration form for font-variant is
font-variant: value

The values you may use for this property are
normal and small-caps.


Demo

<p style="font-variant:small-caps">
This sentence should appear in small capital letters.
</p>

Appears as:

This sentence should appear in small capital letters.

Sample Stylesheet
/* small caps */
.caps { font-variant: small-caps; }

Sample Code
<p>
Do you like <span class="caps">small caps</span>?
</p>

Appears as

Do you like small caps?

PC Screenshot (white page)
PC Screenshot (black page)


WebTV Limitation

WebTV does not support the font-variant property at this time. MSIE, Firefox and Netscape do.

WebTV Solutions

Joanne came up with the simple but brilliant idea of using font-size to simulate font-variant:small-caps. Simply type your text with capital letters and resize some letters with the font-size property.

Example:
<p>T<span style="font-size:85%">HIS SENTENCE HAS SMALL CAPS</span>.</p>


Appears as:

THIS SENTENCE HAS SMALL CAPS.


Assignment

There is no assignment for this property. Call someone you love.

Happy coding!
Gnubee

Links
Tips
Tools
References
Rules
HTML Help Gnubee - Newsgroup
HTML Course Contents (Home)

Valid XHTML 1.0!

Valid CSS!