CSS2 Units
In addition to what we’ve covered, CSS2 adds a small number of new units, almost all of which are concerned with aural style sheets (employed by those browsers that are capable of speech). We’ll briefly cover them here:
- Angle values
Used to define the position from which a given sound should seem to originate. There are three type of angles: degrees (
deg
), grads (grad
), and radians (rad
). For example, a right angle could be declared as90deg
,100grad
, or1.57rad
; in each case, the values are translated into degrees in the range 0 through 360. This is also true of negative values, which are allowed. The measure-90deg
is the same as270deg
.- Time values
Used to specify delays between speaking elements, these values can be expressed as either milliseconds (
ms
) or seconds (s
). Thus,100ms
and0.1s
are equivalent. Time values may not be negative.- Frequency values
Used to declare a given frequency for the sounds that speaking browsers can produce. Frequency values can be expressed as hertz (
Hz
) or megahertz (mHz
) and cannot be negative. The values labels are case-insensitive, so10mHz
and10mhz
are equivalent.
In addition to these values, there is also an old friend with a new
name. A URI
is a Uniform Resource
Identifier
, which is sort of another name for a Uniform Resource Locator (URL). The difference is, for now, mostly semantic, but many authors are beginning to adopt the convention of referring to online addresses as URIs, not URLs. The specification still requires ...
Get Cascading Style Sheets: The Definitive Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.