|
|
#1 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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;
}
|
|
|
|
|
|
#2 |
|
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 85,560
Karma: 93980341
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?
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#4 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,626
Karma: 28549046
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You need to provide a complete example.
|
|
|
|
|
|
#5 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,215
Karma: 8888888
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
Quote:
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
}
|
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82
Karma: 25684
Join Date: Sep 2014
Device: Kindle NT
|
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"> Code:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml"> |
|
|
|
|
|
#7 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,626
Karma: 28549046
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. |
|
|
|
|
|
#8 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,626
Karma: 28549046
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.
|
|
|
|
|
|
#9 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82
Karma: 25684
Join Date: Sep 2014
Device: Kindle NT
|
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Kindle 3 Picture Viewer | Conner | Kindle Developer's Corner | 3 | 03-26-2012 08:32 AM |
| 360 PB 360 rotate in picture viewer? | franklekens | PocketBook | 0 | 07-17-2011 05:49 AM |
| E-Book Viewer as standalone viewer | Peter Swallow | Library Management | 3 | 05-15-2011 01:06 PM |
| Picture Viewer Justification | krunkster | Amazon Kindle | 3 | 02-26-2009 07:30 PM |
| Picture Viewer experiment | skytalon | Amazon Kindle | 11 | 04-04-2008 12:10 PM |