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.

<br />

This text will be beneath everything.<br />

<br />

<br />

This text will underlay text1, but overlay the butterfly image<br />

<br />

<br />

<br />

This example demonstrates the notion of transparency. The default behavior of<br />

a box is to allow boxes behind it to be visible through transparent areas in its<br />

content. In the example, each box transparently overlays the boxes below it. This<br />

behavior can be overridden by using one of the existing background properties<br />

[p. 188] .<br />

9.10 Text direction: the ’direction’ and<br />

’unicode-bidi’ properties<br />

The characters in certain scripts are written from right to left. In some documents,<br />

in particular those written with the Arabic or Hebrew script, and in some<br />

mixed-language contexts, text in a single (visually displayed) block may appear<br />

with mixed directionality. This phenomenon is called bidirectionality, or "bidi" for<br />

short.<br />

The Unicode standard ([UNICODE], section 3.11) defines a complex algorithm<br />

for determining the proper directionality of text. The algorithm consists of an<br />

implicit part based on character properties, as well as explicit controls for embeddings<br />

and overrides. <strong>CSS2</strong> relies on this algorithm to achieve proper bidirectional<br />

rendering. The ’direction’ and ’unicode-bidi’ properties allow authors to specify<br />

how the elements and attributes of a document language map to this algorithm.<br />

If a document contains right-to-left characters, and if the user agent displays<br />

these characters (with appropriate glyphs, not arbitrary substitutes such as a<br />

question mark, a hex code, a black box, etc.), the user agent must apply the bidirectional<br />

algorithm. This seemingly one-sided requirement reflects the fact that,<br />

although not every Hebrew or Arabic document contains mixed-directionality text,<br />

such documents are much more likely to contain left-to-right text (e.g., numbers,<br />

text from other languages) than are documents written in left-to-right languages.<br />

Because the directionality of a text depends on the structure and semantics of<br />

the document language, these properties should in most cases be used only by<br />

designers of document type descriptions (DTDs), or authors of special documents.<br />

If a default style sheet specifies these properties, authors and users<br />

should not specify rules to override them. A typical exception would be to override<br />

bidi behavior in a user agent if that user agent transliterates Yiddish (usually<br />

written with Hebrew letters) to Latin letters at the user’s request.<br />

The HTML 4.0 specification ([HTML40], section 8.2) defines bidirectionality<br />

behavior for HTML elements. Conforming [p. 32] HTML user agents may therefore<br />

ignore the ’direction’ and ’unicode-bidi’ properties in author and user style<br />

sheets. The style sheet rules that would achieve the bidi behavior specified in<br />

[HTML40] are given in the sample style sheet [p. 292] . The HTML 4.0 specifica-<br />

127

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

Saved successfully!

Ooh no, something went wrong!