Quote:
Originally Posted by odedta
PHP Code:
display: table-cell; vertical-align: middle;
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