View Single Post
Old 01-18-2013, 04:04 PM   #4
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
The page-break-before: avoid value doesn't work in WebKit, FireFox, or IE, either.

For page-break-before and page-break-after, you should generally assume that the only fully supported values are always, auto, and inherit.

In most renderers, the values right, and left usually behave like always.

The only place where I've ever seen avoid supported is in the page-break-inside property. I've never seen a browser that supports it in -before or -after properties.

So if you need to prevent a page break between two elements, the best way is to wrap both elements in a div and set page-break-inside: avoid on that outer div. I realize that this isn't necessarily what you're trying to achieve—you might be content with just guaranteeing that there are a couple of widow lines from the previous paragraph on the same page as an image, for example—but it is the closest approximation that works at all currently.

Last edited by dgatwood; 01-18-2013 at 04:08 PM.
dgatwood is offline   Reply With Quote