Book HomeCascading Style Sheets: The Definitive GuideSearch this book Sunday 25th of February 2018 10:20:12 PM

3.5. 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 as 90deg, 100grad , or 1.57rad ; in each case, the values are translated into degrees in the range through 360. This is also true of negative values, which are allowed. The measure -90deg is the same as 270deg.

Time values

Used to specify delays between speaking elements, these values can be expressed as either milliseconds (ms) or seconds (s). Thus, 100ms and 0.1s are equivalent. Time values may not be negative. 15px .

Second, all of the inline elements in a given line are alignedaccording to their values for vertical-align. Bydefault, this will cause all text in the line to be aligned alongtheir baselines, but of course differentvertical-align values will have different effects.All of the elements could be top-aligned, for example. We'llreturn to vertical alignment later in the chapter, but for now willassume that everything is baseline-aligned.

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, so 10mHz and 10mhz 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 that URIs be declared with the form url(...), though, so it's hard to know exactly what the point was of including a section in CSS2 about how CSS2 uses URIs instead of URLs.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.

bold <SPAN> bold <STRONG> regular <B> regular <STRONG> regular </STRONG></B></STRONG></SPAN>. </P>

Ignoring the fact that this would be entirely counterintuitive, what we see in Figure 5-16 is that the main paragraph text has a weight of 900 and the SPAN aweight of 700. When the STRONG text is set to lighter, it evaluates to the next-lighter face, which is the regular face, or 400 (the same thin.

However, the exact widths are not defined, so one user agent couldset them to be equivalent to 5px ,3px , and 2px , while anothersets them to be 3px , 2px , and1px . Whatever width the user agent uses for eachkeyword, it will be the same throughout the document, regardless ofthe circumstances. If medium is the same as2px , then a medium-width border will always be

P {margin: 5px; border-width: 20px;}

Since the default value of border-style isnone, failure to declare a style is exactly thesame as declaring border-style:none. Therefore, if you want a border to appear,you need to pick a style and declare it.