Please visit our sponsors !
CSS Font Properties
CSS Font properties define the font in text.
Examples
Set the font of a text
This example demonstrates how to set a font of a text.
Set the size of the font
This example demonstrates how to set the size of a font.
Set the style of the font
This example demonstrates how to set the style of a font.
Set the variant of the font
This example demonstrates how to set the variant of a font.
Set the boldness of the font
This example demonstrates how to set the boldness of a font.
All the font properties in one
declaration
This example demonstrates how to use the shorthand property for setting all of
the font properties in one declaration.
CSS Fonts
The Font properties allow you to change the font family, boldness,
size, and the style of a text.
Notes - Useful Tips
Fonts are identified by their name in CSS1. Note that if a browser does not
support the font that is specified, it will use a default font.
Font Properties:
NN: Netscape, IE: Internet Explorer, W3C: Web Standard
Property |
Description |
Values |
NN |
IE |
W3C |
font
|
A shorthand property for setting all of the properties for
a font in one declaration |
font-style
font-variant
font-weight
font-size/line-height
font-family
caption
icon
menu
message-box
small-caption
status-bar |
4.0 |
4.0 |
CSS1 |
font-family
|
A prioritized list of font family names and/or generic
family names for an element |
family-name
generic-family |
4.0 |
3.0 |
CSS1 |
font-size
|
Sets the size of a font |
xx-small
x-small
small
medium
large
x-large
xx-large
smaller
larger
length
% |
4.0 |
3.0 |
CSS1 |
font-size-adjust
|
Specifies an aspect value for an element that will preserve
the x-height of the first-choice font |
none
number |
|
|
CSS2 |
font-stretch
|
Condenses or expands the current font-family |
normal
wider
narrower
ultra-condensed
extra-condensed
condensed
semi-condensed
semi-expanded
expanded
extra-expanded
ultra-expanded |
|
|
CSS2 |
font-style
|
Sets the style of the font |
normal
italic
oblique |
4.0 |
4.0 |
CSS1 |
font-variant
|
Displays text in a small-caps font or a normal font |
normal
small-caps |
6.0 |
4.0 |
CSS1 |
font-weight
|
Sets the weight of a font |
normal
bold
bolder
lighter
100
200
300
400
500
600
700
800
900 |
4.0 |
4.0 |
CSS1 |
Jump to: Top of Page
or HOME or
Printer friendly page
Search W3Schools:
What Others Say About Us
Does the world know about us? Check out these places:
Dogpile
Alta Vista
MSN
Google
Excite
Lycos
Yahoo
Ask Jeeves
We Help You For Free. You Can Help Us!
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.
Copyright 1999-2002 by Refsnes Data. All Rights Reserved
|