CSS tutorial font properties Free Web Design Tutorials
Home   HTML CSS JavaScript PHP MySQL Usability Glossary
CSSBasicsImplementing CSSCSS SyntaxPseudo Classes/ElementsCSS ClassesCSS PropertiesCSS font propertiesFontColor and BackgroundTextBorderMargins and PaddingSize and Position

Home > CSS > Font Propertiesprinter version

CSS Font Properties

CSS allows you to set the properties of a font.

Units of Measurement

Font units may either be relative or absolute. Absolute units have no real meaning on a computer screen so are not covered here. Relative units include ...

Example of Setting the Font Properties of a Class
.font_class_name {
font-family: verdana, sans-serif;
font-size: 12px;
font-style: italic;
font-variant: normal;
font-weight: bold
}


PropertyDescriptionValues
font−familyA list of font family names separated by commas (e.g. verdana,helvetica).
and/or
Generic font family names (e.g. serif,sans-serif).

Note: If the name contains spaces then it should be enclosed in quotation marks.
family−name
generic−family
font−sizeSets the size of the font.Absolute
xx-small
x-small
small
medium
large
x-large
xx-large
Relative
larger
smaller
length
em
en
ex
px
percentage
%
font−styleSets the style of the font.normal
italic
oblique
font−variantSets the style as either normal or in upper case at the same size as the lower case letters.normal
small-caps
font−weightSets the boldness of the font.

Note: With numeric units 400=normal and 700=bold.
normal
bold
bolder
lighter
Numeric
100-900


Previous - CSS Classes Previous - CSS Classes     Next - Color and Background Properties Next - CSS Color and Background Properties


Privacy | Terms | Contact | Links | Sitemap | RSS Feeds RSS and JavaScript Feeds
©2009 www.webdesignworkmate.co.uk all rights reserved 
Design and Production by smallbizonline website design © 2000-2009
Valid HTML 4.01! Level Double-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0Valid CSS!
Tips and TricksMenu ButtonsSpecial Effects
Recommended Reading
CSS - the missing manual

The CSS anthology

Beginning CSS web development