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.

If the above doesn’t provide enough break points to keep content from overflowing<br />

the page boxes, then rules B and D are dropped in order to find additional<br />

breakpoints.<br />

If that still does not lead to sufficient break points, rules A and C are dropped<br />

as well, to find still more break points.<br />

Page breaks cannot occur inside boxes that are absolutely positioned [p. 113] .<br />

13.3.5 Forced page breaks<br />

A page break must occur at (1) if, among the ’page-break-after’ and<br />

’page-break-before’ properties of all the elements generating boxes that meet at<br />

this margin, there is at least one with the value ’always’, ’left’, or ’right’.<br />

A page break must also occur at (1) if the last line box above this margin and<br />

the first one below it do not have the same value for ’page’.<br />

13.3.6 "Best" page breaks<br />

<strong>CSS2</strong> does not define which of a set of allowed page breaks must be used;<br />

<strong>CSS2</strong> does not forbid a user agent from breaking at every possible break point,<br />

or not to break at all. But <strong>CSS2</strong> does recommend that user agents observe the<br />

following heuristics (while recognizing that they are sometimes contradictory):<br />

Break as few times as possible.<br />

Make all pages that don’t end with a forced break appear to have about the<br />

same height.<br />

Avoid breaking inside a block that has a border.<br />

Avoid breaking inside a table.<br />

Avoid breaking inside a floated element<br />

Example(s):<br />

Suppose, for example, that the style sheet contains ’orphans : 4’, ’widows : 2’,<br />

and there are 20 lines (line boxes [p. 105] ) available at the bottom of the current<br />

page:<br />

If a paragraph at the end of the current page contains 20 lines or fewer, it<br />

should be placed on the current page.<br />

If the paragraph contains 21 or 22 lines, the second part of the paragraph<br />

must not violate the ’widows’ constraint, and so the second part must contain<br />

exactly two lines<br />

If the paragraph contains 23 lines or more, the first part should contain 20<br />

lines and the second part the remaining lines.<br />

Now suppose that ’orphans’ is ’10’, ’widows’ is ’20’, and there are 8 lines available<br />

at the bottom of the current page:<br />

If a paragraph at the end of the current page contains 8 lines or fewer, it<br />

should be placed on the current page.<br />

If the paragraph contains 9 lines or more, it cannot be split (that would<br />

violate the orphan constraint), so it should move as a block to the next page.<br />

184

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

Saved successfully!

Ooh no, something went wrong!