Open Directory Site CSS Tutorials

ASP | XML | VBScript | JavaScript | ADO | CSS | XMLDOM | PHP | Operating Systems

Home >> CSS >> CSS Font Properties

CSS Font Properties

 

CSS Font properties defines 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

 

Cheap Web Hosting Articles - Web Site Design & Web Hosting Tutorials - Domain Hosting