I use break-after:avoid and it has never failed me. It works well both in epub and after the epub has been converted via calibre to pdf for printing. I use it on centered, bold one-liners of <div style="break-after:avoid">…</div>. This also works well if you want to keep top-caption always together with image below it. (I must admit top-captioned images are less common than images followed by bottom captions.) For the most part I find it more useful to have an image with a bottom AND top caption. I use break-after:avoid as a class and pop it into place with a calibre snippet.
|