Posts tagged ‘font’

CSS Font Properties

CSS Font Properties

The number in the “CSS” column indicates in which CSS version the property is defined (CSS1 or CSS2).

Property Description Values CSS
font Sets all the font properties in one declaration font-style
font-variant
font-weight
font-size/line-height
font-family
caption
icon
menu
message-box
small-caption
status-bar
inherit
1
font-family Specifies the font family for text family-name
generic-family
inherit
1
font-size Specifies the font size of text xx-small
x-small
small
medium
large
x-large
xx-large
smaller
larger
length
%
inherit
1
font-style Specifies the font style for text normal
italic
oblique
inherit
1
font-variant Specifies whether or not a text should be displayed in a small-caps font normal
small-caps
inherit
1
font-weight Specifies the weight of a font normal
bold
bolder
lighter
100
200
300
400
500
600
700
800
900
inherit
1

CSS font style

CSS font properties define the font family, boldness, size, and the style of a text.

Font Family

The font family of a text is set with the font-family property.

The font-family property should hold several font names as a “fallback” system. If the browser does not support the first font, it tries the next font.

Start with the font you want, and end with a generic family, to let the browser pick a similar font in the generic family, if no other fonts are available.

Note: If the name of a font family is more than one word, it must be in quotation marks, like font-family: “Times New Roman”.

More than one font family is specified in a comma-separated list: Continue reading ‘CSS font style’ »