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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

H1 { font-size: 120% }<br />

and this document fragment:<br />

<br />

A large heading<br />

<br />

the ’font-size’ property for the H1 element will have the computed value ’12pt’<br />

(120% times 10pt, the parent’s value). Since the computed value of ’font-size’ is<br />

inherited, the EM element will have the computed value ’12pt’ as well. If the user<br />

agent does not have the 12pt font available, the actual value of ’font-size’ for both<br />

H1 and EM might be, for example, ’11pt’.<br />

6.2.1 The ’inherit’ value<br />

Each property may also have a specified value of ’inherit’, which means that, for<br />

a given element, the property takes the same computed value [p. 70] as the<br />

property for the element’s parent. The inherited value, which is normally only<br />

used as a fallback value, can be strengthened by setting ’inherit’ explicitly.<br />

Example(s):<br />

In the example below, the ’color’ and ’background’ properties are set on the<br />

BODY element. On all other elements, the ’color’ value will be inherited and the<br />

background will be transparent. If these rules are part of the user’s style sheet,<br />

black text on a white background will be enforced throughout the document.<br />

BODY {<br />

color: black !important;<br />

background: white !important;<br />

}<br />

* {<br />

color: inherit !important;<br />

background: transparent;<br />

}<br />

6.3 The @import rule<br />

The ’@import’ rule allows users to import style rules from other style sheets. Any<br />

@import rules must precede all rule sets in a style sheet. The ’@import’ keyword<br />

must be followed by the URI of the style sheet to include. A string is also allowed;<br />

it will be interpreted as if it had url(...) around it.<br />

Example(s):<br />

The following lines are equivalent in meaning and illustrate both ’@import’<br />

syntaxes (one with "url()" and one with a bare string):<br />

@import "mystyle.css";<br />

@import url("mystyle.css");<br />

So that user agents can avoid retrieving resources for unsupported <strong>media</strong><br />

types [p. 77] , authors may specify <strong>media</strong>-dependent @import rules. These<br />

conditional imports specify comma-separated <strong>media</strong> types after the URI.<br />

71

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

Saved successfully!

Ooh no, something went wrong!