Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-08-2016, 08:34 AM   #1
senhal
Connoisseur
senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.
 
senhal's Avatar
 
Posts: 82
Karma: 25684
Join Date: Sep 2014
Device: Kindle NT
Centered picture on e-book viewer

Why the E-book Viewer doesn't centrally align a picture (280x1000 px) when using this code?

Code:
<div class="center"><img alt="Frontispiece" height="100%" src="../Images/frontispiece.jpg" /></div>
Code:
.center {
  text-align: center;
  text-indent: 0;
}
senhal is offline   Reply With Quote
Old 02-08-2016, 08:49 AM   #2
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Can you be more specific? Do you mean that it is not displayed centred on Calibre's ebook viewer, but it is on other devices?
HarryT is offline   Reply With Quote
Old 02-08-2016, 09:04 AM   #3
senhal
Connoisseur
senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.
 
senhal's Avatar
 
Posts: 82
Karma: 25684
Join Date: Sep 2014
Device: Kindle NT
Exactly.
On Calibre Editor, ADE, Kobo and Kindle the picture is centered.
On E-Book Viewer it is not.
senhal is offline   Reply With Quote
Old 02-08-2016, 10:23 AM   #4
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,355
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You need to provide a complete example.
kovidgoyal is online now   Reply With Quote
Old 02-08-2016, 11:07 AM   #5
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,188
Karma: 8888888
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by senhal View Post
Why the E-book Viewer doesn't centrally align a picture (280x1000 px) when using this code?

Code:
<div class="center"><img alt="Frontispiece" height="100%" src="../Images/frontispiece.jpg" /></div>
Code:
.center {
  text-align: center;
  text-indent: 0;
}
Try this:
Code:
<div class="image block"><div class="center"><img alt="Frontispiece" height="100%" src="../Images/frontispiece.jpg" /></div></div>
Code:
.center {
  text-align: center;
  text-indent: 0;
    }
.image block {
    display: block
    }
bernie
gbm is offline   Reply With Quote
Old 02-08-2016, 01:24 PM   #6
senhal
Connoisseur
senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.
 
senhal's Avatar
 
Posts: 82
Karma: 25684
Join Date: Sep 2014
Device: Kindle NT
Quote:
Originally Posted by kovidgoyal View Post
You need to provide a complete example.
Maybe I get it... With this header the problem appears:

Code:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
With this one, everything is ok:

Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">
Attached Files
File Type: epub pix.epub (2.9 KB, 54 views)
senhal is offline   Reply With Quote
Old 02-08-2016, 11:53 PM   #7
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,355
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes, declaring a doctype changes the html rendering algorithm (to an obsolete one), which causes the height='100%' to actually be rendered with a height greater than the page height, so the viewer compensates by forcing the image to be alone on a page, and setting its display to block. This prevents the image from being broken up onto two pages.

Either dont uses doctypes, they are pointless, legacy cruft or use margin-left:auto and margin-right:auto with display:block to center you image.
kovidgoyal is online now   Reply With Quote
Old 02-08-2016, 11:58 PM   #8
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,355
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Even better, if you want a fullpage image, use the svg code for it, which is far more robust. The calibre editor insert image tools has an option to easily insert such full page images.
kovidgoyal is online now   Reply With Quote
Old 02-09-2016, 02:31 AM   #9
senhal
Connoisseur
senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.
 
senhal's Avatar
 
Posts: 82
Karma: 25684
Join Date: Sep 2014
Device: Kindle NT
Quote:
Originally Posted by kovidgoyal View Post
Even better, if you want a fullpage image, use the svg code for it, which is far more robust. The calibre editor insert image tools has an option to easily insert such full page images.
I'm still using it
Thanks for your suggestions!
senhal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle 3 Picture Viewer Conner Kindle Developer's Corner 3 03-26-2012 07:32 AM
360 PB 360 rotate in picture viewer? franklekens PocketBook 0 07-17-2011 04:49 AM
E-Book Viewer as standalone viewer Peter Swallow Library Management 3 05-15-2011 12:06 PM
Picture Viewer Justification krunkster Amazon Kindle 3 02-26-2009 06:30 PM
Picture Viewer experiment skytalon Amazon Kindle 11 04-04-2008 11:10 AM


All times are GMT -4. The time now is 12:40 PM.


MobileRead.com is a privately owned, operated and funded community.