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.

The following <strong>CSS2</strong> will make a drop cap initial letter span two lines:<br />

<br />

<br />

<br />

Drop cap initial letter<br />

<br />

P { font-size: 12pt; line-height: 12pt }<br />

P:first-letter { font-size: 200%; font-style: italic;<br />

font-weight: bold; float: left }<br />

SPAN { text-transform: uppercase }<br />

<br />

<br />

<br />

The first few words of an article<br />

in The Economist.<br />

<br />

<br />

This example might be formatted as follows:<br />

HE FIRST few<br />

T words of an<br />

article in the<br />

Economist<br />

The fictional tag sequence is:<br />

<br />

<br />

<br />

T<br />

he first<br />

<br />

few words of an article in the Economist.<br />

<br />

Note that the :first-letter pseudo-element tags abut the content (i.e., the initial<br />

character), while the :first-line pseudo-element start tag is inserted right after the<br />

start tag of the element to which it is attached.<br />

In order to achieve traditional drop caps formatting, user agents may approximate<br />

font sizes, for example to align baselines. Also, the glyph outline may be<br />

taken into account when formatting.<br />

Punctuation (i.e, characters defined in Unicode [UNICODE] in the "open" (Ps),<br />

"close" (Pe), and "other" (Po) punctuation classes), that precedes the first letter<br />

should be included, as in:<br />

in<br />

the hand<br />

"Abird<br />

is worth<br />

two in the bush,"<br />

says an old proverb.<br />

The :first-letter pseudo-element matches parts of block-<strong>level</strong> [p. 97] elements<br />

only.<br />

Some languages may have specific rules about how to treat certain letter<br />

combinations. In Dutch, for example, if the letter combination "ij" appears at the<br />

beginning of a word, both letters should be considered within the :first-letter<br />

pseudo-element.<br />

67

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

Saved successfully!

Ooh no, something went wrong!