View Single Post
Old 08-15-2010, 11:28 AM   #3
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by charleski View Post
1 Margins lost with a page break
If a block element is styled with the page-break-before/after: always attribute, then the top margin for the first element on the new page will be set to 0 no matter what is specified in the css. This is correct according to Section 13.3.3 of CSS 2.1:

Workaround: use the padding-top attribute instead to force a top margin on the first element of the next page.
note: This only applies to page breaks that are forced through the use of the css 'page-break-*' attribute. Page breaks caused by a new xhtml flow will respect the block margins properly.
You can also use a dummy element for a pagebreak, like this:

Code:
div.pagebreak {
  page-break-before: always;
  height: 0;
  padding: 0;
}

<p>... text before the pagebreak</p>

<div class="pagebreak">&nbsp;</div>

<h3>After the pagebreak</p>
I'm not sure now whether ADE would accept the short and empty form: <div class="pagebreak" />, if it does, that's cleaner. The drawback is you cannot include this forced pagebreak in the CSS for h3.
Jellby is offline   Reply With Quote