Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
font
font-size
font-size-adjust
font-stretch
font-style
font-variant
font-weight
PROPERTY: font-family
font-family
:
family-name
&|
generic-family
Compatibility:
IE4+ N4+
Version:
Level 1
Inherited:
Yes
The
font-family
property allows you to select specific typefaces or a generic family of typefaces.
You can list a prioritized selection of
family-name
and/or
generic-name
typefaces. The program will consider each typeface value in turn and will use the first value it finds that is recognized by the browser. In the list, each typeface value must be separated by a comma. This is one of the few places where commas are used in declaring values for a property. The use of a pair of double quotes to enclose the typeface name is optional. However, it is recommended that any typeface name, such as "helvetica extra bold", that contains blank (white) spaces, should be enclosed by double quotes. Note that single quotes must be used in place of double quotes when using certain HTML code.
family-name
The
family-name
typeface values are the font names, such as: Courier, Arial, Times, Roman, etc. It is not possible to present a definitive list since not all computers have all typefaces installed.
generic-family
There are five values of generic-name typefaces to choose from:
cursive
fantasy
monospace
serif
sans-serif
It is recommended that
generic-name
typeface values be used as a last resort.
Code:
p { font-family: Courier, "Zapf Dingbat", serif}
or
<span style="font-family: arial;">Arial </span>
<span style="font-family: courier;">Courier </span>
<span style="font-family: helvetica;">Helvetica </span>
<span style="font-family: palatino;">Palatino </span>
<span style="font-family: symbol;">Symbol </span>
<span style="font-family: times;">Times </span>
output:
Arial
Courier
Helvetica
Palatino
Symbol
Times
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information