View Single Post
Old 07-21-2014, 04:10 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,444
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I doubt there's any method that will work for all readers/devices. But the best technique I know of is to make an absolutely positioned div of fixed height and set its margins to auto.

This will of course only work if your vertically centered content is the only content in a single html file.

A more complex, but similar in spirit technique is to use SVG. IIRC there is a demo of this in the calibre epub advanced formatting demo.
kovidgoyal is offline   Reply With Quote