Specifications

- 66 -
References
For more information about inheritance and how it works with cascading, see Inheritance and Cascading Styles in
CSS (http://www.webdesignfromscratch.com/html-css/css-inheritance-cascade/) and Assigning property values,
Cascading, and Inheritance (http://www.w3.org/TR/CSS2/cascade.html).
NOTE:w3.org is the website of the World Wide Web Consortium, responsible for developing the standards used on
the Web.
CSS and Fonts
Font properties
Through your style sheet, you can specify many properties of the text that appears on your website (properties in
boldface are very common).
font-family
Specifies a prioritized list of font family names.
See "The fallback stack" below for details.
font-size
Specifies the desired height of characters.
Typical units are
pt
(points),
px
(pixels),
%
(percent) and
em
(the current font size)
font-weight
Specifies the weight of characters in a font (their "blackness" or stroke thickness).
Typical values are
bold
and
normal
.
font-style
Allows you to specify an italic or oblique typeface (they are not always the same!).
Typical values are
normal
and
italic
.
color
Sets the color of text.
Values are typically a color name (such as black or red) or a hex number representing an RGB
value (such as
#000000
or
#FFFFFF
, for black or white).
text-indent
Indents the first line of text in an element.
line-height
Specifies the distance between lines of text in an element.
text-align
Specifies the horizontal alignment of text in an element.
vertical-
align
Specifies the vertical alignment of an element.
background-
color
Sets the color of the page behind the text.
text-
transform
Specifies the case of text in an element.
text-
decoration
Adds a decoration to text.
The value line-through allows you to create text that looks like it has been struck out. Using
blink or underline is generally frowned upon (underlining is typically reserved for links, and
blinking text is just plain annoying).
white-space
Determines how white space (spaces, tabs, carriage returns) inside an element is handled.
word-spacing
Allows you to increase or decrease the space between words.
letter-
spacing
Allows you to increase or decrease the space between characters.
font-variant
Allows selecting a small-caps variant of a font face.
font-stretch
Selects a normal, condensed, or expanded face from a font family.
font-size-
adjust
Specifies an aspect ratio adjustment for fonts in the fallback stack.
direction
Specifies the direction in which text is read.
For details on text and font properties, see the CSS Reference at w3schools.org
(http://www.w3schools.com/css/css_reference.asp).
The fallback stack
Usually, when you visit a website, your browser is limited to displaying fonts that are present on your computer, so
web designers have been careful to use what have been known as "web-safe" fonts.