View Single Post
Old 04-16-2014, 04:50 PM   #11
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,543
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by odedta View Post

PHP Code:
displaytable-cell;
vertical-alignmiddle
That should do it.
Not necessarily In fact, that will vertically center anything inside the "table-cell" but, what is the height of that table-cell? If you don't set a height for the "cell" then it will have a default height (that is, the height of object that contains). But of that way, the object will be centered in the cell but the cell won't be centered in the page. You also need something like:

Code:
html, body {
    height: 100%;
}

.container {
    display: table;
    height: 100%;
}

.content {
    display: table-cell;
    vertical-align: middle;
    height: 100%;
}
And in the .xhtml file:

Code:
<body>
  <div class="container">
     <div class="content">
        The content you want vertically centered in the page
     </div>
  </div>
</body>
This will work ok for iPad, the new Kindle devices (those who support .kf8), maybe works in Kobo but it can have some issues under ADE

Regards
Rubén

Last edited by RbnJrg; 04-16-2014 at 04:58 PM.
RbnJrg is offline   Reply With Quote