View Single Post
Old 10-07-2014, 11:15 AM   #6
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by RbnJrg View Post
Images are not the same as text. It's possible that ereaders will display images centered using the text-align property but it’s not a good idea. Instead, you should specify that the image is a block element. Then you can center it as you would a block:

Code:
img.centered {
      display: block;
      margin-left: auto;
      margin-right: auto;
}
and

Code:
<div class="centre">
       <img class="centered" alt="valid html, css, and epub" src="../Images/valid.png" width="25%" />
</div>
I think that should work on iBooks

Regards
Rubén
This would not work on the majority of the readers out there. The auto value is converted to 0 for margins on those. That is not even a mistake, the specs allow that.

In iBooks it could work.

Last edited by Toxaris; 10-07-2014 at 11:27 AM.
Toxaris is offline   Reply With Quote