Quote:
Originally Posted by Turtle91
This has worked for me for several years. I wish I could remember who I got it from on the internetz...
I think it was Hitch that mentioned Kindle/Amazon doesn't like Tables, but I'm not sure if "doesn't like" equates to "doesn't work".  I don't use Kindle - except to immediately convert it to ePub.
|
Well, sheesh, Turtle, in what decade? At one point in time, around the genesis of this thread, it was "doesn't work." Later, it was "doesn't like" (and still doesn't, really), with them working on KF8, and spastically on KF7, and now, they work, except, if you have a long one, it kills Enhanced Typesetting. Aren'tcha glad you commented?
Quote:
edit: The technique doesn't actually use "tables" it simply uses the properties of tables in the CSS for "display:table-cell".
You can have any number of items within the inner div and it'll vertically center on the page. Works great for title pages, dedications, Book/Part headings, etc.
Cheers,
Code:
<head>
<title>Vertical Center</title>
<style>
/* Vertically centered on page */
div.v-ctr {height:100%; width:100%; display:table; position:fixed; padding:0; margin:0; text-indent:0}
div.v-ctr div {display:table-cell; vertical-align:middle; padding:0; margin:0}
</style>
</head>
<body>
<div class="v-ctr">
<div>
<p>Centered</p>
</div>
</div>
</body>
</html>
|
We use this faux "qualities of tables" coding for a variety of things, and mostly, it works. I have some vague recollection of this not working that well, for vert. centering, but I'll have to investigate and remind myself of the what/why.
Hitch