22.12.2013 Views

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

mm: millimeters<br />

pt: points -- the points used by <strong>CSS2</strong> are equal to 1/72th of an inch.<br />

pc: picas -- 1 pica is equal to 12 points.<br />

Example(s):<br />

H1 { margin: 0.5in } /* inches */<br />

H2 { line-height: 3cm } /* centimeters */<br />

H3 { word-spacing: 4mm } /* millimeters */<br />

H4 { font-size: 12pt } /* points */<br />

H4 { font-size: 1pc } /* picas */<br />

In cases where the specified length cannot be supported, user agents must<br />

approximate it in the actual value.<br />

4.3.3 Percentages<br />

The format of a percentage value (denoted by in this specification)<br />

is an optional sign character (’+’ or ’-’, with ’+’ being the default) im<strong>media</strong>tely<br />

followed by a im<strong>media</strong>tely followed by ’%’.<br />

Percentage values are always relative to another value, for example a length.<br />

Each property that allows percentages also defines the value to which the<br />

percentage refers. The value may be that of another property for the same<br />

element, a property for an ancestor element, or a value of the formatting context<br />

(e.g., the width of a containing block [p. 96] ). When a percentage value is set for<br />

a property of the root [p. 30] element and the percentage is defined as referring<br />

to the inherited value of some property, the resultant value is the percentage<br />

times the initial value [p. 69] of that property.<br />

Example(s):<br />

Since child elements (generally) inherit the computed values [p. 70] of their<br />

parent, in the following example, the children of the P element will inherit a value<br />

of 12pt for ’line-height’, not the percentage value (120%):<br />

P { font-size: 10pt }<br />

P { line-height: 120% } /* 120% of ’font-size’ */<br />

4.3.4 URL + URN = URI<br />

URLs (Uniform Resource Locators, see [RFC1738] and [RFC1808]) provide the<br />

address of a resource on the Web. An expected new way of identifying resources<br />

is called URN (Uniform Resource Name). Together they are called URIs (Uniform<br />

Resource Identifiers, see [URI]). This specification uses the term URI.<br />

URI values in this specification are denoted by . The functional notation<br />

used to designate URIs in property values is "url()", as in:<br />

Example(s):<br />

BODY { background: url("http://www.bg.com/pinkish.gif") }<br />

The format of a URI value is ’url(’ followed by optional whitespace [p. 37]<br />

followed by an optional single quote (’) or double quote (") character followed by<br />

the URI itself, followed by an optional single quote (’) or double quote (") character<br />

followed by optional whitespace followed by ’)’. The two quote characters<br />

must be the same.<br />

46

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!