The Book of CSS3 - A Developer\'s Guide to the Future of Web Design (2nd edition)

(C. Jardin) #1

16


Values and sizing


Much of CSS3, from its many new selectors
to layout and font properties, is designed to
give you more granular control over presenta-
tion than was available in CSS2.1. That control will
be even more evident in this chapter, as I introduce

new value functions and units, as well as methods to
calculate dimensions automatically.

Relative Length Units


In CSS a relative length unit is one whose value is relative to another prop-
erty. The two relative units in CSS2.1 are em, which is calculated from the
font-size property of an element, and ex, which is calculated from the
x-height of the element’s font (see “font-size-adjust” on page 56).
CSS3 expands the range of relative units, which are no longer relative
solely to an element’s font size. The new units are defined in the Values and
Units Module (http://www.w3.org/TR/css-values/).

PX

3024
Free download pdf